Skip to content

Instantly share code, notes, and snippets.

View fizerkhan's full-sized avatar

Fizer Khan (பைசர் கான்) fizerkhan

View GitHub Profile
@fizerkhan
fizerkhan / TwentyBot
Last active August 29, 2015 14:21 — forked from CodyWalker/TwentyBot
function countPieces() {
it = b.pieces();
var i = 0;
while (it.current()){ i++; it.next() }
return i;
}
function getRandPiece() {
var it = b.pieces();
var n = Math.floor(Math.random()*countPieces());
@fizerkhan
fizerkhan / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@fizerkhan
fizerkhan / beacon.js
Last active August 29, 2015 14:19 — forked from ruturajv/beacon.js
http = require('http');
url = require('url');
http.createServer(function(req, res){
var requestURL = url.parse(req.url, true)['pathname'];
if (requestURL == '/log.gif') {
var imgHex = '47494638396101000100800000dbdfef00000021f90401000000002c00000000010001000002024401003b';
var imgBinary = new Buffer(imgHex, 'hex');
res.writeHead(200, {'Content-Type': 'image/gif' });
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@fizerkhan
fizerkhan / index.html
Last active August 29, 2015 14:16 — forked from EpokK/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<div class="steps">
<a href="" class="step step1">1</a>
<div class="line line1"></div>
<a href="" class="step step2">2</a>
<div class="line line2"></div>
<script type="text/javascript">
BOOMR.init({
beacon_url: "/boomerang.gif",
BW: {
enabled: false
}
});
BOOMR.subscribe('before_beacon', trackInAnalytics);
var pageType = "homepage"; // customize this
global
log 127.0.0.1 local0 notice
maxconn 50000
daemon
stats socket /tmp/proxystats level admin
defaults
log global
mode http
option httplog
option dontlognull
<!DOCTYPE html>
<html>
<head>
<title>Timeline</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
</head>
<body>
<p>This is a basic example of creating your own Timeline for viewing in the Web Inspector Timeline view.</p>
<p>Save the string logged to the console in a JSON file. Then load into the Timeline.</p>
</body>