Skip to content

Instantly share code, notes, and snippets.

View chee's full-sized avatar
🍕
partying

chee chee

🍕
partying
View GitHub Profile
#include <stdio.h>
/* just forking yr while loops */
main()
{
int age, legal;
age = 10;
// Britishising.
legal = 18;
@chee
chee / github_issues_to_csv.rb
Created August 7, 2012 15:49
Exports Github issues to CSV (API v3)
#!/usr/bin/env ruby
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="___USERNAME___"
PASSWORD="___PASSWORD___"
# Project you want to export issues from
USER="IRISInc"
var replayURL = 'http://fightcodegame.com/robots/replay/';
var ai = 'duck';
function load ( event ) {
event.preventDefault();
var playerNumber = $( '#playerNumber' ).val();
var replayID = $( '#replayID' ).val();
$.get( replayURL + replayID ).done(function ( data ) {
(defun delete-frame-or-quit ()
(interactive)
(condition-case nil
(delete-frame)
(error save-buffers-kill-terminal)))
(global-set-key (kbd "C-x C-c") 'delete-frame-or-quit)
var through = require("through2");
module.exports = function () {
return through.obj(function(file, enc, callback) {
console.log(file, enc, callback);
this.push(file);
return callback();
});
};
// bizarguments is a v8 anomaly
function abc() {
return def();
}
function def() {
return abc.arguments[0] * 2;
}
abc(50); // >> 100
function getPrimes(max) {
return Array.apply(null, {length: max + 1}).map(function(){}.call, Number).filter(function(n) {
if (n < 2) return false;
for (var i = 2; i <= Math.sqrt(n); i++) {
if (n % i == 0) return false;
}
return true;
});
}
@chee
chee / alpha.js
Last active August 29, 2015 14:01 — forked from angus-c/alpha.js
(a=Array).apply(0,a(123)).map(String.fromCharCode).slice(97)
i=96,r=[];while(i++<122)r.push(String.fromCharCode(i));r
'abcdefghijklmnopqrstuvwxyz'.split('')
String.fromCharCode[b='apply'](0,(a=Array)[b](0,a(123)).map(a.call,Number)).slice(97)
i=97,eval(Array(27).join('String.fromCharCode(i++)+')+'""')
@chee
chee / index.js
Created May 12, 2016 01:59
curl my ip
require('http').createServer((request, response) => {
response.statusCode = 200
response.setHeader('Content-Type', 'text/plain')
response.end(request.connection.remoteAddress)
}).listen(80)
import hoistStatics from 'hoist-non-react-statics'
import React from 'react'
/**
* Allows two animation frames to complete to allow other components to update
* and re-render before mounting and rendering an expensive `WrappedComponent`.
*/
export default function deferComponentRender(WrappedComponent) {
class DeferredRenderWrapper extends React.Component {
constructor(props, context) {