Skip to content

Instantly share code, notes, and snippets.

View alkavan's full-sized avatar
🌴

Igal Alkon alkavan

🌴
View GitHub Profile
@alkavan
alkavan / git-bear-repo-deployment
Last active September 4, 2015 18:05 — forked from rafi/post-receive
Deploy with git
mkdir ~/git/website.git && cd ~/git/website.git
git init --bare
mkdir ~/webapps/website
git config receive.denycurrentbranch ignore
git config core.bare false
git config core.worktree ~/webapps/website ; NO TRAILING SLASH!!! Will screw up things real bad.
; create a hook
nano hooks/post-receive
$(document).ready(function() {
$('form').live('submit', function()
{
var form = $(this);
var action = form.attr('action');
$.post(action, form.serialize(), function(response)
{
form.replaceWith(response);
<?php defined('SYSPATH') or die('No direct script access.');
/**
* User to user communication wrapper. Uses Swift Mailer for email transport.
*
* @package Communicate
* @category Base
* @author Woody Gilk <woody@wingsc.com>
* @copyright (c) 2010 Woody Gilk
* @license MIT
*/
@shadowhand
shadowhand / install-kohana.sh
Created November 8, 2010 06:29
A script to install the Kohana PHP Framework
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"
@alkavan
alkavan / linux_console_commands.sh
Last active August 29, 2023 11:23
All kind of useful Linux commands.
# I book marked some sites with useful Linux commands i found.
# then i noticed they were down, so i loaded them via google cache, and copied here.
# source: http://blog.urfix.com/
# source: http://www.pixelbeat.org/cmdline.html
# Enjoy!
# How to run process as background and never die
#
# nohup means: Do not terminate this process even when the stty is cut off.
# > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
@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
@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 / 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 / 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++
#------------------------------------------------------------------------------
@r-lyeh-archived
r-lyeh-archived / grid.hpp
Last active December 14, 2015 22:48
A 2D/3D collision grid
// A 2D/3D collision grid. MIT licensed
// - rlyeh, 2012
#pragma once
#include <map>
#include <set>
#include <cassert>
#include <tuple>