This is now an actual repo:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Slim::hook('slim.before.dispatch', function () { | |
list( $type, $controller_name, $controller_action ) = array_merge( explode( '.', Slim::router()->current()->getName() ), array( null,null,null ) ); | |
if( $type == 'controller' ) { | |
$file = './controllers/'.$controller_name.'.controller.class.php'; | |
if( !is_readable( $file ) ) { return false; } | |
require_once( './controllers/base.controller.class.php' ); | |
require_once( $file ); | |
$class = $controller_name.'Controller'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: test libtest.so testmodule | |
libtest.so: libtest.c | |
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc | |
test: test_main.c libtest.o | |
$(CC) -o $@ $? | |
testmodule: testmodule.c | |
python setup.py build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created: Sat Aug 05 02:19:40 EDT 2006 | |
* | |
* A base class for application wide E-Mail sending/logic inspired | |
* by the Ruby on Rails ActionMailer. | |
* | |
* The Actionmailer is a hybrid of a Model and Controller since it | |
* renders it's own views to be send out via mail. The easiest way to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
DIR=/tmp/watchdog | |
# Create dir if it doesn't exist | |
if [ ! -d $DIR ]; then | |
mkdir $DIR | |
fi | |
cd $DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, cookieSessions = require('./cookie-sessions'); | |
var app = express(); | |
app.use(express.cookieParser('manny is cool')); | |
app.use(cookieSessions('sid')); | |
app.get('/', function(req, res){ | |
req.session.count = req.session.count || 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> | |
<script type="text/javascript" src="js/ui.tabs.closable.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Widop\Mink\Extension; | |
/** | |
* Dictionary to manage popups. | |
* | |
* @author Benjamin Lazarecki <[email protected]> | |
*/ | |
trait PopupDictionary |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
OlderNewer