Skip to content

Instantly share code, notes, and snippets.

View ericcholis's full-sized avatar

Eric Cholis ericcholis

View GitHub Profile
@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
@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();
});
});
@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}')
)
)
);
@mehlah
mehlah / li3.vim
Created April 16, 2012 14:01
vim color scheme, the Lithium style !
" Vim color file
" Maintainer: Mehdi Lahmam B. (mehlah)
" Inspired by Li3 color scheme - http://dev.lithify.me/lithium/wiki/about/visual-identity
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@tmaiaroto
tmaiaroto / cron.php
Created April 20, 2012 18:12
Lithium Cron Wrapper
<?php
/**
* This script is meant to be executed via crontab.
* It should help you easily set li3 commands as cron jobs.
*
* You should put this in the root of your application.
* However, you don't need to, but you would then need to
* pass a --path= option with the path to your app.
* This is because the li3 console command must be called
* from a specific location.
@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;
@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 ]
});
@kevinballard
kevinballard / example.py
Created May 22, 2013 22:04
Example script for commandr.
from commandr import command, Run
@command('greet')
def Hi(name, title='Mr.', times=1):
'''Greet someone.
Arguments:
name - Name to greet.
title - Title of the person to greet.
times - Number of times to say the greeting. '''
greeting = 'Hi %s %s!' % (title, name)
@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
@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;