Skip to content

Instantly share code, notes, and snippets.

@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
@iamcal
iamcal / css-slack-plaid.markdown
Created August 19, 2016 18:07
CSS SLACK plaid
@iamcal
iamcal / unstuck.php
Created April 16, 2018 21:51
I'm pretty sure this a decoder for something in Homestuck
<html>
<head>
<title>Unstuck</title>
<style>
#main {
text-align: left;
margin: 30px auto;
width: 760px;
}
@iamcal
iamcal / bounces.pl
Created April 20, 2018 18:33
Process bounces in an IAMP inbox
use Mail::IMAPClient;
use Data::Dumper;
my $imap = Mail::IMAPClient->new(
Server => 'mail.mxes.net',
User => 'ACCOUNT',
Password => 'PASSWORD',
Ssl => 0,
Uid => 1,
);
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
$|++;
my @hot = qw[
nun
<?
$lines = file('http://www.worldofwarcraft.com/realmstatus/status.xml');
foreach ($lines as $line){
if (preg_match('!Hyjal!', $line)){
preg_match_all('!([a-z]+)="([^"]*)"!', $line, $m, PREG_SET_ORDER);
$out = array();
@iamcal
iamcal / debug.js
Created January 8, 2019 05:13
xul runner helper script
function myDumpO(x, no_recurse){
myDump(parse_obj("", x, no_recurse));
}
function parse_obj(prefix, x, no_recurse){
//myDump('called with '+no_recurse+' and '+prefix.length);