Skip to content

Instantly share code, notes, and snippets.

View vincentwoo's full-sized avatar

Vincent Woo vincentwoo

View GitHub Profile
@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
[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:
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

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);
{
"topLevelItems": ["1", "2", "3", "4"],
"items": {
"1": {
"parent": null,
"title": "Books",
"children": ["11", "12", "13"]
},

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

@vincentwoo
vincentwoo / preload
Last active December 16, 2015 09:09
900ish classes I needed in mini-rt.tar to not need to pull stuff over the wire
classes/util/Javac.class
vendor/classes/com/sun/source/tree/ArrayAccessTree.class
vendor/classes/com/sun/source/tree/ArrayTypeTree.class
vendor/classes/com/sun/source/tree/AssignmentTree.class
vendor/classes/com/sun/source/tree/BinaryTree.class
vendor/classes/com/sun/source/tree/BlockTree.class
vendor/classes/com/sun/source/tree/CatchTree.class
vendor/classes/com/sun/source/tree/ClassTree.class
vendor/classes/com/sun/source/tree/CompilationUnitTree.class
vendor/classes/com/sun/source/tree/EnhancedForLoopTree.class
@vincentwoo
vincentwoo / JSFoot HTML (Rails).tmLanguage
Last active December 15, 2015 17:59 — forked from anonymous/JSFoot HTML (Rails).tmLanguage
Save as SUBLIME_DIRECTORY/Packages/User/JSFoot HTML (Rails).tmLanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>html.erb</string>
</array>
<key>name</key>
<string>JSFoot HTML (Rails)</string>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>html.erb</string>
</array>
<key>name</key>
<string>JSFoot HTML (Rails)</string>
@vincentwoo
vincentwoo / gist:5168806
Last active December 14, 2015 23:49
heroku database_url issue
vwoo@vwoo-VirtualBox:~/tweetshirt$ heroku pg:promote HEROKU_POSTGRESQL_ROSE_URL
Promoting HEROKU_POSTGRESQL_ROSE_URL to DATABASE_URL... done
vwoo@vwoo-VirtualBox:~/tweetshirt$ git push heroku master
Counting objects: 288, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (268/268), done.
Writing objects: 100% (288/288), 54.12 KiB, done.
Total 288 (delta 127), reused 3 (delta 0)
-----> Ruby/Rails app detected