Skip to content

Instantly share code, notes, and snippets.

@iamcal
iamcal / gist:11301201
Created April 25, 2014 19:56
keybase.md
### 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:
@iamcal
iamcal / gist:d1d9e8a99ab8af46a782
Created August 9, 2014 16:30
Particle Clicker hinter
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);
}
@iamcal
iamcal / status.php
Created August 27, 2014 17:25
Parse mod_status output for localhost
<?php
#
# scoreboard stuff
#
echo file_get_contents('http://localhost/server-status?auto');
echo "\n";
#
{ "SERVERUSED" : "LIGHTHOUSE.5.MONGOLAYER.COM/54.70.204.247:10001" , "LASTOP" : { "$TS" : 0 , "$INC" : 0} , "CONNECTIONID" : 7940 , "ERR" : "MULTI UPDATE ONLY WORKS WITH $ OPERATORS" , "CODE" : 9 , "N" : 0 , "OK" : 1.0}
# npm publish
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursiv
GNU nano 2.0.6 File: /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
bind-address=10.210.215.67
function joinBuffers(b1, b2){
// if one arg is null, be smart
if (!b1) return b2;
if (!b2) return b1;
var l1 = b1.length;
var l2 = b2.length;
var b3 = new Buffer(l1 + l2);
<?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";
}
@iamcal
iamcal / gist:1033478
Created June 18, 2011 20:22
Installing yum on a Centos 5 box (MediaTemple dv 3.5)
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
@iamcal
iamcal / gist:1468403
Created December 12, 2011 18:12
Merging to a parent repo after it accepts your changes
$ 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