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
@alkavan
alkavan / gource-commands.txt
Created April 11, 2010 16:41
Gource and ffmpeg Commands
################################
gource commands
################################
# basic command for big and long projects
gource --max-user-speed 500 --seconds-per-day 0.05 --file-idle-time 10 -e 0.005 -f --max-files 300 --hide-files
# some easy to understand commands
# for output file
--output-ppm-stream ~/ppm/ppm-kohana
@alkavan
alkavan / sksort.php
Created June 24, 2010 12:47
sksort
<?php
/**
* A function to sort data array element by one or two sub keys, both directions
*/
function sksort(&$array, $subkey = "id", $subkey2 = null ,$sort_ascending=false)
{
if (count($array))
$temp_array[key($array)] = array_shift($array);
@alkavan
alkavan / SimplePlugin.php
Created August 14, 2010 15:58
statusnet simple plugin
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of SimplePlugin
*
* @author alkavan
@alkavan
alkavan / deflate.conf
Created November 9, 2010 23:29
Apache 2.2 mod_deflate configuartion
#
# my mod_deflate settings, it's important not to uncomment last AddOutputFilterByType!
#
<IfModule mod_deflate.c>
DeflateCompressionLevel 7
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
AddOutputFilterByType DEFLATE application/javascript application/x-javascript
#AddOutputFilterByType DEFLATE application/x-httpd-php
@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 / 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 / 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 / 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"