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
/** | |
* Allowing Users To Invoke Methods Before A Component Is Rendered | |
* | |
* @see http://www.sencha.com/blog/2010/08/27/tips-and-tricks-for-ext-js-component-developers/ | |
*/ | |
someMethod: function() { | |
if (!this.rendered) { | |
this.on('render', this.someMethod, this, {single: true}); | |
return; |
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 | |
spl_autoload_register(function ($class) { | |
$file = $__DIR__.'/relative/path/to/Monolog/src/'.strtr($class, '\\', '/').'.php'; | |
if (file_exists($file)) { | |
require $file; | |
return true; | |
} | |
}); |
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 | |
/** | |
* A FormSchemaFormatter to use with Twitter Bootstrap CSS. | |
* | |
* @author malteo | |
*/ | |
class sfWidgetFormSchemaFormatterBootstrap extends sfWidgetFormSchemaFormatter | |
{ | |
protected |
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
Ext.ns('Ext.ux.state'); | |
/** | |
* @class Ext.ux.state.LocalStorageProvider | |
* @extends Ext.state.Provider | |
* A Provider implementation which saves and retrieves state via the HTML5 localStorage object. | |
* If the browser does not support local storage, an exception will be thrown upon instantiating | |
* this class. | |
* <br />Usage: | |
<pre><code> |
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
from fabric.api import cd, env, local, prefix, run, sudo | |
env.hosts = ['cs01.actalis.vpn'] | |
env.project_root = '/home/libersoft/visalaid' | |
env.user = 'libersoft' | |
def push(): | |
local('git push') |
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 | |
while read -r line | |
do | |
echo "$line$(pwgen -s 16 1)" | |
done < $1 >temp | |
mv temp $1 |
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
$app->get('/admin/print/{course_id}/{generated}', function ($course_id, $generated) use ($app) { | |
$query = $app['idiorm']->getTable('keys') | |
->select('code') | |
->where('course_id', $course_id) | |
->where('generated', $generated); | |
$stream = function () use ($query) { | |
$out = fopen('php://output', 'w'); | |
foreach ($query->find_array() as $key) { | |
fputcsv($out, $key); |
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
# /etc/init/uptime.conf | |
description "uptime" | |
author "malte" | |
start on runlevel [2345] | |
stop on runlevel [^2345] | |
# Restart when job dies | |
respawn |
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 | |
/** | |
* This is what happens when you don't catch a case in your switches, Larry. | |
*/ | |
class ShouldntHappenException extends \RuntimeException | |
{ | |
const COMBO_BREAKER = 'C-C-C-COMBO BREAKER!'; | |
/** |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>URLbot</title> |
OlderNewer