Skip to content

Instantly share code, notes, and snippets.

View shiawuen's full-sized avatar

Tan Shiaw Uen shiawuen

View GitHub Profile
var page = require('webpage').create();
var system = require('system');
page.open(system.args[1], function(){
var ret = page.evaluate(function(){
var each = [].forEach;
var residency_code = {
# given r34 is the bad commit
svn merge -c -34 .
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
function lookup(obj /*Object */, props/* String */){
if ( ! (obj && props)) { return undefined; }
var ps = props.split('.');
var pointer = obj;
var val = undefined;
var i = 0, len = ps.length;
for(;i<len;i++) {
module.exports = function(grunt){
function slug(str){
return str.replace(/\W/g, '-')
.replace(/^\W|\W$/g, '')
.toLowerCase();
}
grunt.initConfig({
@shiawuen
shiawuen / index.html
Created April 16, 2014 03:33
Scroll hash change
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.block {
border: 1px solid #666;
box-shadow: 2px 2px 2px #333;
background: #f1f1f1;
{
elType: [
{ type: 10, el: 'h1' },
{ type: 11, el: 'h2' },
{ type: 12, el: 'h3' },
{ type: 13, el: 'h4' },
{ type: 14, el: 'h5' },
{ type: 15, el: 'h6' },
{ type: 2, el: 'p' },
{ type: 3, el: 'a' },
class FileSystem {
constructor () {
this.tree = {}
this.binaries = {}
}
add ({ type, name, path = '/'}) {
if (! (type && name))
throw Error('missing required parameters')
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width"/>
<title>Modular Template Patterns</title>
<!--
This email is an experimental proof-of-concept based on the
idea that the most common design patterns seen in email can
@shiawuen
shiawuen / email-large.json
Last active September 16, 2015 05:33
test
This file has been truncated, but you can view the full file.
{
"tree": [
{
"id": "cid73x8k0003x3k5959csf4tn",
"type": "Row",
"size": 1,
"children": [
{
"id": "cid73x8k0003y3k59hgnr1vp1",
"type": "Column",