Skip to content

Instantly share code, notes, and snippets.

View ericcholis's full-sized avatar

Eric Cholis ericcholis

View GitHub Profile
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@themartorana
themartorana / build.py
Created May 17, 2011 15:54
build.py
import os, sys
import datetime
import base64
import cloudservers
import cloudlb
import urllib2
#import paramiko
from time import sleep
@nrstott
nrstott / app.js
Created September 21, 2011 15:01
Bogart CouchDB Blog code translated to use MongoDB
var bogart = require('bogart');
var Q = require('promised-io/lib/promise');
var mongoose = require('mongoose');
var PostSchema = new mongoose.Schema({
title: String,
body: String,
comments: [ CommentSchema ]
});
@ericcholis
ericcholis / object-watch.js
Created October 27, 2011 13:02 — forked from eligrey/object-watch.js
Cross-browser object.watch and unwatch. Modified for use with MooTools and MooTools More
// Cross-browser object.watch and object.unwatch
// Requires Mootools 1.4 or greater
// object.watch
(function(){
if (!Object.prototype.watch) {
Object.implement('watch',function(prop,handler){
var oldval = this[prop], newval = oldval,
getter = function () {
return newval;
@nateabele
nateabele / routes.php
Last active June 16, 2017 13:05
Lithium continuation route examples
<?php
/**
* Continuation routing examples. Handles URLs in the following forms:
*
* /posts
* /en/posts
* /admin/posts
* /admin/en/posts
* /admin/en/posts.json
* /admin/en/posts/4ef16ccc7f8b9aa331000064.json
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@jeduan
jeduan / reveal_ajax.js
Created February 9, 2012 00:15
Use Zurb reveal with ajax
$('a.reveal').click(function(event) {
event.preventDefault();
var $div = $('<div>').addClass('reveal-modal').appendTo('body'),
$this = $(this);
$.get($this.attr('href'), function(data) {
return $div.empty().html(data).append('<a class="close-reveal-modal">&#215;</a>').reveal();
});
});
@nateabele
nateabele / media.php
Created February 17, 2012 17:44
An example of how to completely reconfigure Lithium's templating engine
<?php
use lithium\net\http\Media;
/**
* This re-maps your template paths so you can have stuff like `pages/users_{username}.php`
* instead of the Lithium default.
*/
Media::type('html', 'text/html', array(
'view' => 'lithium\template\View',
@tmaiaroto
tmaiaroto / System.php
Created February 21, 2012 16:29
A model class to help you work with some more advanced features of MongoDB using the Lithium PHP framework.
<?php
/**
* A System model to work with MongoDB from a higher level.
* This model will executes various commands as well as store new commands.
* The system.js collection is used.
*
* Warning: There be dragons in here.
*
*/
namespace app\models;
@mariuskubilius
mariuskubilius / config\bootstrap\action.php
Created March 18, 2012 17:38
LI3 Change layout depending whether admin continuation route is used or not
use lithium\action\Dispatcher;
//Allow admin continuation routes to be made.
Dispatcher::config(
array(
'rules' => array(
'admin' => array('action' => 'admin_{:action}')
)
)
);