This file contains hidden or 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
function nano() { | |
nano=`which nano`; | |
if ([ -e "$1" ] && ! [ -w "$1" ]) || ( ! [ -e "$1" ] && ! [ -w "`dirname $1`" ]); then | |
read -n 1 -p "$1 is not editable by you. sudo [y/N]? " y | |
[ "$y" == "y" ] || [ "$y" == "Y" ] && echo -e "\n" && sudo $nano $@ | |
else | |
$nano $@ | |
fi | |
} |
This file contains hidden or 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 | |
function hide_cursor($stream = STDOUT) { | |
fprintf($stream, "\033[?25l"); // hide cursor | |
register_shutdown_function(function() use($stream) { | |
fprintf($stream, "\033[?25h"); //show cursor | |
}); | |
} |
This file contains hidden or 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 | |
/** | |
* Write colorized text to a stream | |
* | |
* @param $stream | |
* @param $text | |
* @param $args | |
*/ | |
function cprintf($stream, $text, $args = null) { |
This file contains hidden or 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 | |
/** | |
* @author Gerard van Helden <[email protected]> | |
*/ | |
class FooBuilder { | |
protected $properties = array(); | |
function add($property, $value) { | |
$this->properties[$property][] = $value; |
This file contains hidden or 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
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> | |
<!-- =============================================================== --> | |
<!-- Configure stderr and stdout to a Jetty rollover log file --> | |
<!-- this configuration file should be used in combination with --> | |
<!-- other configuration files. e.g. --> | |
<!-- java -jar start.jar etc/jetty-logging.xml etc/jetty.xml --> | |
<!-- =============================================================== --> | |
<Configure id="Server" class="org.mortbay.jetty.Server"> |
This file contains hidden or 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 name="author" content="Gerard van Helden <[email protected]>"> | |
<style type="text/css"> | |
div#container { | |
position: relative; | |
} |
This file contains hidden or 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 bash | |
function a { | |
echo "let's do A!" | |
} | |
function b { | |
echo "Let's do B!" | |
} |
This file contains hidden or 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> | |
<body> | |
<pre id="canvas" style="font-size:20px; font-weight:bold;"></pre> | |
</body> | |
</html> | |
<script type="text/javascript"> |
This file contains hidden or 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 | |
/** | |
* @author Gerard van Helden <[email protected]> | |
* @copyright Zicht Online <http://zicht.nl> | |
*/ | |
require_once 'vendor/autoload.php'; | |
class MyConf implements \Symfony\Component\Config\Definition\ConfigurationInterface | |
{ |
This file contains hidden or 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 | |
/** | |
* @author Gerard van Helden <[email protected]> | |
* @copyright Zicht Online <http://zicht.nl> | |
*/ | |
require_once 'vendor/autoload.php'; | |
class MyConf implements \Symfony\Component\Config\Definition\ConfigurationInterface | |
{ |
OlderNewer