Skip to content

Instantly share code, notes, and snippets.

View vincentwoo's full-sized avatar

Vincent Woo vincentwoo

View GitHub Profile

Client Services Code Exercise

Using HTML, CSS, and JavaScript, you will create a tool that allows a user to drill down through a tree of categories and select a final category. The taxonomy data is represented as a tree of categories. A category can have any number of children. A category with no children is considered a selectable category (categories with children should not be selectable).

The taxonomy data is located at https://gist.github.com/5527862

{
"topLevelItems": ["1", "2", "3", "4"],
"items": {
"1": {
"parent": null,
"title": "Books",
"children": ["11", "12", "13"]
},

JavaScript

Imagine you have the following function, which is a function that takes a really long time to square a number. It takes a number to square, and a callback that it will eventually call with the result of squaring that number.

function slowSquare(x, callback) {
  setTimeout(function() {
    callback(x * x);
  }, 500);
require 'rest-client'
require 'json'
# usage: Firepad.load 'coderpad.firebaseio.com/111111'
# => 'contents of the last revision of your firepad'
module Firepad
def self.load base_url
resp = RestClient.get "https://#{base_url}/history.json"
resp = JSON.parse resp
[2013-11-18 11:39:14] Configuring Rubinius...
[2013-11-18 11:39:14] Command line: ""
[2013-11-18 11:39:14] Checking gcc:
[2013-11-18 11:39:14] found
[2013-11-18 11:39:14] Checking g++:
[2013-11-18 11:39:14] found
[2013-11-18 11:39:14] Checking bison:
[2013-11-18 11:39:14] found
[2013-11-18 11:39:14] Configuring LLVM...
[2013-11-18 11:39:14] Checking for existing LLVM library tree:
@vincentwoo
vincentwoo / gist:7797905
Created December 5, 2013 00:03
nprof output
Vincents-MacBook-Air:~ vwoo$ nprof
Statistical profiling result from v8.log, (643958 ticks, 12 unaccounted, 0 excluded).
[Unknown]:
ticks total nonlib name
12 0.0%
[Shared libraries]:
ticks total nonlib name
636845 98.9% 0.0% /lib/x86_64-linux-gnu/libc-2.17.so
@vincentwoo
vincentwoo / README.md
Last active August 29, 2015 13:56 — forked from nicerobot/README.md

Objective-C on Linux

Just run:

curl -ks https://gist.github.com/vincentwoo/8892428/raw/install.sh | bash -
@vincentwoo
vincentwoo / gist:816bbcc5bb4bad1a9798
Last active August 29, 2015 14:01
FirePad TODOs

HIGH

  • 125 (to-do checklists broken) - looks like some rich text gnarliness
  • 109 (error when undoing in specific case) - looks like some rich text gnarliness
  • 112 (CodeMirror 4 support) - doable but may be tricky to support backwards compatability
  • 126 (node.js module to export content server-side; shouldn’t be too hard) - not sure exactly what this means but sounds doable

MEDIUM

vwoo@execute:~/coderpad-tty$ sudo grep 42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96 /var/log/upstart/docker.log
2014/08/22 16:46:53 POST /containers/42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96/attach?stream=true&stdin=true&stdout=true
[4e4b5027] +job container_inspect(42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96)
[4e4b5027] -job container_inspect(42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96) = OK (0)
[4e4b5027] +job attach(42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96)
2014/08/22 16:46:53 POST /containers/42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96/start
[4e4b5027] +job start(42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96)
2014/08/22 16:46:53 POST /containers/42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96/stop
[4e4b5027] +job stop(42dddcc2b60b407812a6d87bb8f16b85ea7457071f2533bed7fc69850cde6e96)
[4e4b5027] -job stop(42dddcc2b60b407812a6d87bb8f16b85ea74570
+ go test github.com/docker/docker/integration
[b09bf5b9] +job init_networkdriver()
[b09bf5b9] -job init_networkdriver() = OK (0)
[b09bf5b9] +job image_inspect(docker-test-image)
No such image: docker-test-image
[b09bf5b9] -job image_inspect(docker-test-image) = ERR (1)
[b09bf5b9] +job pull(docker-test-image)
Pulling repository docker-test-image
Pulling image (latest) from docker-test-image
Pulling image (latest) from docker-test-image, endpoint: https://registry-1.docker.io/v1/