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
// create list of unused stylesheet rules | |
$(document).ready(function() | |
{ | |
var sel = []; | |
for( var s = 0 ; s < document.styleSheets.length ; s++ ) { | |
var rules = document.styleSheets[s].cssRules || document.styleSheets[s].rules; | |
for( var r = 0 ; r < rules.length ; r++ ) { |
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 | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'; | |
} | |
parse_git_dirty() { | |
[[ ! $(git status) =~ "nothing to commit (working directory clean" ]] && echo " ⚡ " | |
} | |
export PS1='\[\033[01;30m\] [$(parse_git_branch)\[\033[01;33m\]$(parse_git_dirty)\[\033[01;30m] \[\033[00m\]'$PS1 |
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" | |
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 | |
/** | |
* simpele gradient image adhv GET parameters | |
* | |
* @author Stefan Stubbe | |
*/ | |
// default settings definiëren | |
$defaults = array( |
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
#!/usr/bin/env php | |
<?php | |
/* original version can be found at https://gist.github.com/181172 */ | |
if( ! function_exists( 'inotify_init' ) ) { | |
die_with_error( 'This script needs the inotify module' ); | |
} | |
$excludePatterns = array( |
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 Base64 = { | |
characters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" , | |
encode: function( string ) | |
{ | |
var characters = Base64.characters; | |
var result = ''; | |
var i = 0; | |
do { |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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 | |
class Example_Controller extends Zend_Controller_Action | |
{ | |
public function indexAction() | |
{ | |
$db = $this->getHelper('resource')->db; | |
} | |
} |
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 | |
$flatten = function( $array , $keySeparator = '.' ) use ( & $flatten ) | |
{ | |
if( is_array( $array ) ) { | |
foreach( $array as $name => $value ) { | |
$f = $flatten( $value , $keySeparator ); | |
if( is_array( $f ) ) { | |
foreach( $f as $key => $val ) { | |
$array[ $name . $keySeparator . $key ] = $val; |
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 | |
if( $_SERVER['argc'] === 1 ) { | |
printf( | |
'No error level specified as argument (%s <errorlevel>), using current error_reporting value...' . PHP_EOL | |
, $_SERVER['argv'][0] | |
); | |
$errorlevel = error_reporting(); | |
} else { |
OlderNewer