Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
cd ~/
mkdir .git-completion
wget -O ./.git-completion/prompt.sh https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh --no-check-certificate
wget -O ./.git-completion/completion.sh https://raw.github.com/git/git/master/contrib/completion/git-completion.bash --no-check-certificate
echo "
#git completion
source ~/.git-completion/completion.sh
@arieh
arieh / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@arieh
arieh / $count.js
Created February 11, 2010 22:59
A Javascript/Mootools method that implements a generic count method for all variable types
function $count(obj){
var childs = [];
if (!obj) return 0;
switch($type(obj)){
case 'number' : return obj;
case 'function':
return ((obj+"").test(/[{]([\W]*[\w]+[\W\w]*)[}]/)) ? 1: 0;
#!/bin/sh
#==========
# Settings
#==========
# Is this shell runing in cygwin (1/0)
cygwin=0;
# Drive containing www folder (only needed for cygwin users)
@arieh
arieh / AJAX_Example.js
Created September 9, 2010 08:18
This is an example for my AJAX blog post
(function(window,undef){
//get a new XMLHttpRequest object
function getXHR(){
//for IE:
if (window.ActiveXObject){
try{ //newer version
return new ActiveXObject('MSXML2.XMLHTTP');
}catch (e){//older version
@arieh
arieh / JSClass.php
Created October 5, 2010 11:00
This class is a proof of concept of how you can use the new Closures in PHP5.3 to import JS paradigms into PHP
<?php
class JSClass{
/**
* @var array a container for all of the Class's members and methods.
*/
private $params = array();
/**
* @param array $params a list of members and methods to assign to the Class
* @access private
@arieh
arieh / Break.js
Created October 21, 2010 14:34
Adds a Break function to $each (Mootools 1.3)
function BreakException(){}
function Break(){throw new BreakException;}
(function(window,undef){
window['$each'] = function(obj,func,bind){
try{
switch (typeOf(obj)){
case 'object':
<?php
/**
*Benchmark class, it's a good solution for testing your web applications and scripts!
*also it can be a permanent tool you can integrate into your systems that will indicate the performance of your app/script etc.
* Test Time and memory consumption!
* Example usage:
*
* <code>
* require('Benchmark.class.php');
* Benchmark::startTimer();
@arieh
arieh / dabblet.css
Created December 16, 2011 17:57
Untitled
div.tip{
margin:100px 150px;
width:25px;
height:25px;
border:1px solid orange;
border-radius:50%;
background:linear-gradient(top, #f9f44a 2%, #ffa51e 61%, #d17308 100%);
position:relative;
cursor:pointer;
}
@arieh
arieh / dabblet.css
Created December 16, 2011 17:28 — forked from anonymous/dabblet.css
Untitled
div.tip{
margin:100px 150px;
width:25px;
height:25px;
border:1px solid orange;
border-radius:50%;
background:linear-gradient(top, #f9f44a 2%, #ffa51e 61%, #d17308 100%);
position:relative;
cursor:pointer;
}