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 | |
# | |
# scoreboard stuff | |
# | |
echo file_get_contents('http://localhost/server-status?auto'); | |
echo "\n"; | |
# |
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
function best_research(){ | |
var ranks = []; | |
for (var i=0; i<GameObjects.research.length; i++){ | |
var r = GameObjects.research[i]; | |
ranks.push([r.name, 1000*r.reputation/r.cost, r.cost<=GameObjects.lab.data]); | |
} | |
ranks.sort(function(a,b){return b[1]-a[1]}); | |
return format_items("Research", ranks); | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am iamcal on github. | |
* I am iamcal (https://keybase.io/iamcal) on keybase. | |
* I have a public key whose fingerprint is C568 1CFB 8867 08A1 A921 855E 27C8 7757 FADA 9ADB | |
To claim this, I am signing this object: |
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_once 'ApnsPHP/Autoload.php'; | |
$message = new ApnsPHP_Message('1234567890123456789012345678901234567890123456789012345678901234'); | |
$message->setText("Hello \\uD83D\\uDCC5"); | |
print_r($message->getPayload()); | |
echo "\n"; | |
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 POE; | |
use POE::Component::IRC::Common; | |
use POE::Component::IRC::State; | |
use POE::Component::IRC::Plugin::AutoJoin; |
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
switch ($a) | |
case 1: | |
#this runs if case 1 is true | |
case 2: | |
case 3: | |
#this runs if case 1, 2 or 3 are true | |
break; | |
case 4: | |
#this runs if case 4 is 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
function consistent_hash($path, $servers){ | |
$hash = hexdec(substr(md5($path), 0, 5)); | |
return $cache[$hash % count($servers)]; | |
} | |
$server = consistent_hash($path_to_asset, array('cache1', 'cache2')); |
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
$ git remote add parent git://github.com/shiflett/testmore.git | |
$ git fetch parent | |
$ git branch parent-master parent/master | |
$ git checkout parent-master | |
$ git checkout master | |
$ git merge parent-master | |
$ git push origin master | |
$ git branch -d parent-master |
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
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/nspr-4.8.6-1.el5.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/nspr-devel-4.8.6-1.el5.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/nss-3.12.8-1.el5.centos.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/nss-devel-3.12.8-1.el5.centos.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/cpio-2.6-23.el5_4.1.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/nss-3.12.8-1.el5.centos.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/nss-devel-3.12.8-1.el5.centos.i386.rpm | |
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/popt-1.10.2.3-22.el5.i386.rpm |
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 | |
mysql_connect('localhost', 'root', 'root'); | |
mysql_select_db('porn'); | |
$result = mysql_query("SELECT * FROM images WHERE has_goats=1 AND has_nuns=1"); | |
while ($row = mysql_fetch_array($result)){ | |
echo "<img src=\"$row[image]\" />\n"; | |
} |