This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'delegate' | |
class A | |
end | |
class B < SimpleDelegator | |
def initialize(obj) | |
super(obj) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Karma E2E configuration | |
module.exports = function (config) { | |
config.set({ | |
// base path, that will be used to resolve files and exclude | |
basePath: '', | |
// list of files / patterns to load in the browser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/f75759a3f97fadffe6aa | |
:host = http://127.0.0.1:4444/wd/hub | |
GET :host/status | |
######################## | |
# Session/Browser API | |
######################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @fileoverview Program to free the content in kindle books as plain HTML. | |
* | |
* This is largely based on reverse engineering kindle cloud app | |
* (https://read.amazon.com) to read book data from webSQL. | |
* | |
* Access to kindle library is required to download this book. | |
*/ | |
// The Kindle Compression Module copied from http://read.amazon.com application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Script to convert ttyrec file to gifs on OSX with Terminal.app.""" | |
import argparse | |
import os | |
import sys | |
import struct | |
import glob | |
import time | |
import subprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun yangchenyun-org/post-init-org () | |
;; Disable whitespace-mode highlighting | |
(message "post init org is executed") | |
(with-eval-after-load 'org | |
(progn | |
(defvar org-dir "~/Dropbox/.org") | |
(setq org-bullets-bullet-list '("■" "◆" "▲" "▶")) | |
(setq org-directory (expand-file-name org-dir) | |
org-agenda-files (list (concat org-dir "/plans.org") | |
(concat org-dir "/work.org") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.benchmark = function() { | |
const countSet = [ | |
1, 10, 100, 1000 | |
]; | |
const cookie = "__utma=27069237.741610204.1414116129.1427060728.1427929525.10; __utmc=27069237; EXPERIMENTS_EXCLUSIVE_OPTIN=False; wide=1; llbcs=2;"; | |
const msgSet = [ | |
undefined, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_handleOauth(e, detail) { | |
const systemErrorCodes = [ | |
'auth/auth-domain-config-required', | |
'auth/operation-not-allowed', | |
'auth/operation-not-supported-in-this-environment', | |
'auth/timeout', | |
]; | |
const userErrorCodes = [ | |
'auth/account-exists-with-different-credential', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handles each epoch by receiving an unordered array of proposed transactions, checking each | |
* transaction for correctness, returning a mutually valid array of accepted transactions, and | |
* updating the current UTXO pool as appropriate. | |
*/ | |
public Transaction[] handleTxs(Transaction[] possibleTxs) { | |
// The side effect is to advance the state of the pool. | |
// Convert the unordered list into a graph, and perform topological sort | |
/** Mapping from hash to corresponding transaction. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compareGen(leader, runner, leadStr='') { | |
const runnerNxt = runner.next(); | |
if (runnerNxt.done) { | |
if (leadStr !== '') { | |
return false; // NOTE: The runner loses | |
} | |
const leaderNxt = leader.next(); | |
if (leaderNxt.done) { |