Skip to content

Instantly share code, notes, and snippets.

View hokein's full-sized avatar

Haojian Wu hokein

  • Google
  • Munich, Germany
View GitHub Profile
@hokein
hokein / index.html
Created July 17, 2015 07:57
Steam-overlay-bug
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello Greenworks</title>
<script src="main.js"></script>
</head>
<body>
<h1>Greenworks Test</h1>
@hokein
hokein / index.html
Last active August 29, 2015 14:21
file input element
<!DOCTYPE html>
<html>
<head>
<script src="test.js"></script>
</head>
<input id="openFile" type="file" />
</body>
</html>
@hokein
hokein / test-multiplelines.js
Last active August 29, 2015 14:16
Atom Performance
test:[
{"id":"1","name":"Afghanistan","nativeName":"","tld":[".af"],"cca2":"AF","ccn3":"004","cca3":"AFG","currency":["AFN"],"callingCode":["93"],"capital":"Kabul","altSpellings":["AF","Afgann"],"relevance":"0","region":"Asia","subregion":"Southern Asia","language":["Pashto","Dari"],"languageCodes":["ps","uz","tk"],"translations":{"cy":"Affganistan","de":"Afghanistan","es":"Afganistan","fr":"Afghanistan","it":"Afghanistan","ja":"abc","nl":"Afghanistan","hr":"Afganistan"},"latlng":[33,65],"demonym":"Afghan","borders":["IRN","PAK","TKM","UZB","TJK","CHN"],"area":652230},
{"id":"1","name":"Afghanistan","nativeName":"","tld":[".af"],"cca2":"AF","ccn3":"004","cca3":"AFG","currency":["AFN"],"callingCode":["93"],"capital":"Kabul","altSpellings":["AF","Afgann"],"relevance":"0","region":"Asia","subregion":"Southern Asia","language":["Pashto","Dari"],"languageCodes":["ps","uz","tk"],"translations":{"cy":"Affganistan","de":"Afghanistan","es":"Afganistan","fr":"Afghanistan","it":"Afghanistan","ja":"abc","nl":"Afghanistan

Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4)

by Keith Rosenberg (netpoetica)

Note: do this in some sort of project/ directory that makes sense. depot_tools are going to need to be in your path, so you may want to install them somewhere you are comfortable with.

1) Get the v8 source

git clone https://github.com/v8/v8.git

2) Install depot tools

// remove all the *.vcxproj in current directory recursively
find . -name "*.vcxproj" --exec rm {} \;
@hokein
hokein / random_generator.cpp
Created December 27, 2013 08:12
A random number generator.
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
const int MOD = 10;
int main() {
@hokein
hokein / unversion_tracked_svn_file.sh
Created November 16, 2013 02:52
unversion svn files.
#for a in `find -name "$1"`
#for a in `find . -type d -name ".*"`
for a in `find . -type f -name ".*"`
do
echo "running: svn rm --keep-local $a"
svn rm --keep-local $a
done
@hokein
hokein / index.js
Created September 16, 2013 13:19
Sample code of node beginner. http://www.nodebeginner.org/index-zh-cn.html
var server = require("./server");
var router = require("./router");
var requestHandler = require("./requestHandlers");
var handle = {}
handle["/"] = requestHandler.start;
handle["/start"] = requestHandler.start;
handle["/upload"] = requestHandler.upload;
handle["/show"] = requestHandler.show;
@hokein
hokein / index.html
Created February 26, 2013 08:45
This is the chrome sample app which writing the image file from chrome.tabs.captureVisibleTab call to HTML5 file system.
<!DOCTYPE html>
<html>
<head>
<script src="main.js"></script>
</head>
<body>
<p>Hello World!</p>
<button id="showButton" >Click me</button>
<div id="screenshot"></div>
</body>
@hokein
hokein / input.nfg
Created December 4, 2012 14:25
gambit issue2 test case
NFG 1 R "Biterror Game" { "Terrorist" "State" }
{
{ "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" }
{ "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
"11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" "61" "62" "63" "64" "65" "66" "67" "68" "69" "70" "71" "72" "73" "74" "75" "76" "77" "78" "79" "80" "81" "82" "83" "84" "85" "86" "87" "88" "89" "90" "91" "92" "93" "94" "95" "96" "97" "98" "99" "100" "101" "102" "103" "104" "105" "106" "107" "108" "109" "110" "111" "112" "113" "114" "115" "116" "117" "118" "119" "120" "121" "122" "123" "124" "125" "126" "127" "128" "129" "130" "131" "132" "133" "134" "135" "136" "137" "138" "139" "140" "141" "142" "143" "144" "145" "146" "147" "148" "149" "150" "151" "152" "153" "154" "155" "156" "157" "158" "159" "160" "161" "162" "163" "164