Skip to content

Instantly share code, notes, and snippets.

View rtsao's full-sized avatar

Ryan Tsao rtsao

View GitHub Profile
@rtsao
rtsao / gist:80e2969bb1765431eef4
Last active August 29, 2015 14:04
Timo.com alien fix #nostalgia
  1. Go to timo.com
  2. command+option+i (this opens the javascript console)
  3. Copy and paste in code the below then hit enter

var a=document.createElement("img");a.src="alien.gif";a.style.position="absolute";document.body.appendChild(a);setInterval(function(){if(Math.abs(ex-x0)>=10){x0+=Math.floor((ex-x0)*.1)}else if(ex!=x0){x0+=Math.abs(ex-x0)/(ex-x0)}if(Math.abs(ey-y0)>=10){y0+=Math.floor((ey-y0)*.1)}else if(ey!=y0){y0+=Math.abs(ey-y0)/(ey-y0)}imagesrc="";if(exMath.abs(y0-ey)/2){imagesrc="alien_l.gif";if(x0-exy0)imagesrc="alien_lu.gif"}}if(ex>x0&&ex-x0>Math.abs(y0-ey)/2){imagesrc="alien_r.gif";if(ex-x0y0)imagesrc="alien_ru.gif"}}if(imagesrc==""){if(eyy0)imagesrc="alien_u.gif";if(ex==x0&&ey==y0)imagesrc="alien.gif"}a.src=imagesrc;a.style.left=x0-32;a.style.top=y0},100)

@rtsao
rtsao / README.md
Last active August 29, 2015 14:08 — forked from mbostock/.block
@rtsao
rtsao / README.md
Last active August 29, 2015 14:08 — forked from mbostock/.block
@rtsao
rtsao / index.js
Last active August 29, 2015 14:26
requirebin sketch
var postcss = require('postcss');
// var extend = require('postcss-simple-extend');
var extend = require('postcss-extend');
var nested = require('postcss-nested');
var css = [
"",
".real { .child { color: green} &:before { color: blue } }",
"%ph { .child { color: green} &:before { color: blue } }",
"",
@rtsao
rtsao / index.js
Created December 4, 2015 19:02
requirebin sketch
var escodegen = require('escodegen');
var wtf = escodegen.generate({
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
@rtsao
rtsao / index.js
Created December 4, 2015 19:02
requirebin sketch
var escodegen = require('escodegen');
var wtf = escodegen.generate({
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
@rtsao
rtsao / index.js
Created February 1, 2016 21:44
requirebin sketch
var escodegen = require('escodegen');
var output = escodegen.generate({
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "r"
},
"arguments": [{
"type": "ObjectExpression",
@rtsao
rtsao / bench.js
Created November 24, 2016 01:33
SSR escaping
const _ = require('lodash');
const randomatic = require('randomatic');
const Benchmark = require('benchmark');
const {table} = require('table');
/**
* TEST CODE
*/
function control(_string) {
@rtsao
rtsao / package.json
Last active July 12, 2017 23:56
Universal JS library entry proposal
{
"main": "./dist/node.cjs.js",
"module": "./dist/node.es.js",
"browser": {
"./dist/node.cjs.js": "./dist/browser.cjs.js",
"./dist/node.es.js": "./dist/browser.es.js"
},
"es2015": {
"./dist/node.cjs.js": "./dist/node.cjs.es2015.js",
"./dist/node.es.js": "./dist/node.es.es2015.js",

Keybase proof

I hereby claim:

  • I am rtsao on github.
  • I am rtsao (https://keybase.io/rtsao) on keybase.
  • I have a public key ASBRjamhjcwMSne4XR_kzc2dCUZNwDCP-buvp5xjzAap5Ao

To claim this, I am signing this object: