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 SplIp extends SplType | |
{ | |
const __default = 0; | |
public function __construct($initial_value = '0.0.0.0', $strict = true) | |
{ | |
if ($strict && ip2long($initial_value) === false) { | |
throw new Exception('Invalid IP'); | |
} |
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 | |
$c = new HRTime\StopWatch; | |
$c->start(); | |
/* do some interesting stuff*/ | |
$c->stop(); | |
$elapsed0 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND); | |
/* do something else */ |
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 perl | |
# Author: Todd Larason <[email protected]> | |
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ | |
# use the resources for colors 0-15 - usually more-or-less a | |
# reproduction of the standard ANSI colors, but possibly more | |
# pleasing shades | |
# colors 16-231 are a 6x6x6 color cube | |
for ($red = 0; $red < 6; $red++) { |
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
strong, b { | |
font-weight: bold; | |
} |
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 | |
require 'vendor/autoload.php'; | |
$loop = React\EventLoop\Factory::create(); | |
$dnsResolverFactory = new React\Dns\Resolver\Factory(); | |
$dns = $dnsResolverFactory->createCached('8.8.8.8', $loop); | |
$connector = new React\SocketClient\Connector($loop, $dns); |
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/perl | |
use strict; | |
use warnings; | |
if ( $#ARGV < 1 ) { | |
print "Usage : dumpgit.pl <git upper dir> <target dir>\n"; | |
exit 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
#! /usr/bin/env perl | |
use strict; | |
use warnings; | |
our %services = ( | |
'nginx' => '~/Library/LaunchAgents/homebrew.mxcl.nginx.plist', | |
'php55' => '~/Library/LaunchAgents/homebrew.mxcl.php55.plist', | |
'gearman' => '~/Library/LaunchAgents/homebrew.mxcl.gearman.plist', | |
'memcached' => '~/Library/LaunchAgents/homebrew.mxcl.memcached.plist', |
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/perl | |
use strict; | |
use warnings; | |
use POSIX qw/floor ceil/; | |
my @data; | |
while ( <> ) { | |
chomp; |
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 | |
COLUMNS=15 | |
x=`tput op` | |
y=`printf %$((${COLUMNS}-6))s` | |
for i in {0..256} | |
do | |
o=00$i | |
echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x | |
done |
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/perl | |
use strict; | |
use warnings; | |
if ( $#ARGV < 0 ) { | |
print "Usage : dumpsvn.pl <svn root dir>\n"; | |
exit 1; | |
} |
OlderNewer