Skip to content

Instantly share code, notes, and snippets.

View oelmekki's full-sized avatar

kik oelmekki

View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
require 'readline'
module Gem
class StreamUI
def say( statement = '' )
@@buffer ||= []
#!/usr/bin/env bash
if [[ -z $1 ]]; then
echo 'you must specify a shortcut name'
exit
fi
dir="$(pwd)"
echo "$1=\"$dir\"" >> ~/.bashrc
" taken from http://www.vim.org/tips/tip.php?tip_id=860
" CountMatches counts the number of times a pattern matches a
" range of lines
function! CountMatches(pattern, startline, endline) range
let l:match_count = 0
let l:restore_cursor = "normal!" . line(".") . "G" . virtcol(".") . "|"
normal! H
let l:restore_screen = line(".") . "normal!zt"
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
HOOK_PATH=$(dirname $(readlink -f "$0"))
tmp="$HOOK_PATH"/../..
<?php
class Foo
{
public function __construct()
{
sleep( 1 );
}
}
/**
* TableSorter
* @param: options (request,action,destination,prev,next,rows,method,head)
* @return void;
*/
var TableSorter = new Class({
Implements: [Options],
options:{
request: '', action: '', destination: '', prev: '', next: '', rows: 50, method: 'get', head: ''
},
>>> parseInt( '', 10 )
NaN
>>> typeof( parseInt( '', 10 ) )
"number"
" File: tab_name.vim
" Author: Nickolay Golubev
" Email: golubev.nikolay@gmail.com
" Description: script allow set names for tab pages ( "Call stack", "Help tab", "Broswser" for example ). Useful for console tab mode
" Usage:
" :TName 'tabname' - set name for current tab page
" :TNoName - remove name (page name = buffer name)
if exists('tab_name_plugin')
finish
<?php
/**
* PHPSpec
*
* LICENSE
*
* This file is subject to the GNU Lesser General Public License Version 3
* that is bundled with this package in the file LICENSE.
* It is also available through the world-wide-web at this URL:
* http://www.gnu.org/licenses/lgpl-3.0.txt