Skip to content

Instantly share code, notes, and snippets.

Avatar

Haojian Wu hokein

  • Google
  • Munich, Germany
View GitHub Profile
@hokein
hokein / index.html
Created Feb 26, 2013
This is the chrome sample app which writing the image file from chrome.tabs.captureVisibleTab call to HTML5 file system.
View index.html
<!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 / random_generator.cpp
Created Dec 27, 2013
A random number generator.
View random_generator.cpp
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
const int MOD = 10;
int main() {
View unversion_tracked_svn_file.sh
#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
View index.js
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 / input.nfg
Created Dec 4, 2012
gambit issue2 test case
View input.nfg
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
@hokein
hokein / index.html
Created Jul 17, 2015
Steam-overlay-bug
View index.html
<!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 Aug 29, 2015
file input element
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="test.js"></script>
</head>
<input id="openFile" type="file" />
</body>
</html>
View test-multiplelines.js
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
View Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4).md

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

View remove_file_recursively
// remove all the *.vcxproj in current directory recursively
find . -name "*.vcxproj" --exec rm {} \;