Skip to content

Instantly share code, notes, and snippets.

@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: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;
}
@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: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 / Outliner.js
Created April 23, 2012 12:41
Cross-Lib accessible outline removal
/*!
Copyright (c) <2012> <Arieh Glazer>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE