Skip to content

Instantly share code, notes, and snippets.

View alkavan's full-sized avatar
😀
sup?

Igal Alkon alkavan

😀
sup?
View GitHub Profile
wget -O data.xml --auth-no-challenge --user=<username> --password=<password> https://my.api.url.com/apiDownloadFile

Copy entire database into another one mysqldump -u [user] -p[pass] [source_db] | mysql -u [user] -p[pass] [target_db]

@alkavan
alkavan / static_and_dynamic_dispatch.cpp
Last active October 14, 2015 01:17 — forked from anonymous/static and dynamic dispatch in C++
great explanation by Alan Johnson about static and dynamic dispatch in C++.
/*
* @link http://stackoverflow.com/questions/13600934/why-is-the-virtual-keyword-needed
* @author Alan Johnson
* > Hi,
* >
* > Can someone explain to me what static and dynamic dispatch are and what
* > the difference is between the two? Do this even occurr in C++?
* >
* > Thanks
*
@alkavan
alkavan / Makefile
Created December 7, 2012 18:44
basic makefile for c++ project
# basic makefile for c++ project
SOURCE=main.cpp your_include.h
MYPROGRAM=shellgap
MYINCLUDES=
MYLIBRARIES=
CC=g++
#------------------------------------------------------------------------------
@alkavan
alkavan / set-mouse-to-human-sensitivity.sh
Created November 25, 2012 19:00
script for setting mouse sensitivity to human speed on fedora 17
#!/bin/bash
# if you need to set mouse sensitivity on X or gnome3 to value lower than the
# mouse configuration utility provides, this is the script for you.
# script built for fedora 17, but it should work for some other distros as well.
echo -e "\ncheck the 'id' of you mouse device ...\n"
xinput
echo "---- ---- ---- ----"
@alkavan
alkavan / funtoo-install
Created May 4, 2012 09:14
Install inscructions for Funtoo/Gentoo Linux
# Install vmware x11 video driver
emerge -va x11-drivers/xf86-video-vmware
@alkavan
alkavan / xorg.conf
Created April 28, 2012 19:44
funtoo Xorg Configuration
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc/"
FontPath "/usr/share/fonts/TTF/"
FontPath "/usr/share/fonts/OTF"
@alkavan
alkavan / build-php.sh
Created March 6, 2012 13:28
Compile PHP (on CentOS)
#!/bin/bash
# This is my compile command
# works good for me with PHP 5.3/5.4
# You might need this packages too (CentOS 5/6 tested)
#sudo yum install libxml2-devel.x86_64
#sudo yum install httpd-devel.x86_64
#sudo yum install openssl-devel.x86_64
@alkavan
alkavan / kohana_events.php
Created July 2, 2011 15:56
kohana events
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Plugin Controller Template
* @file \modules\plugin\classes\controller\template\plugin.php
*/
abstract class Controller_Template_Plugin extends Controller_Template
{
public $event_markdown = TRUE;
public function before()
@alkavan
alkavan / json.php
Created June 12, 2011 19:59
JSON Helper for Kohana v3
<?php defined('SYSPATH') or die('No direct script access.');
/**
* JSON helper class
*
* Examples:
* $j = JSON::decode('{"Organization": "Kohana"}'); // Good
* $j = JSON::decode("{'Organization': 'Kohana'}"); // Invalid
* $j = JSON::decode('{"Organization": "Kohana"}', NULL, 1); // depth stack exceeded
*
* @package Kohana