Skip to content

Instantly share code, notes, and snippets.

@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 / 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
#!/bin/sh
#==========
# Settings
#==========
# Is this shell runing in cygwin (1/0)
cygwin=0;
# Drive containing www folder (only needed for cygwin users)
@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;