Skip to content

Instantly share code, notes, and snippets.

View jsyeo's full-sized avatar
๐Ÿ’ญ
๐Ÿ’ ๐”๐“พ๐“ฎ๐Ÿฅถ๐“ฑ๐“พ๐“ช :female_fairy: ๐“น๐“ฒ๐“ช๐“ธ๐Ÿ˜ป๐“น๐“ฒ๐“ช๐“ธ๐Ÿ‘ฃ

Jason Yeo jsyeo

๐Ÿ’ญ
๐Ÿ’ ๐”๐“พ๐“ฎ๐Ÿฅถ๐“ฑ๐“พ๐“ช :female_fairy: ๐“น๐“ฒ๐“ช๐“ธ๐Ÿ˜ป๐“น๐“ฒ๐“ช๐“ธ๐Ÿ‘ฃ
View GitHub Profile
@jsyeo
jsyeo / gettyp.ml
Created October 25, 2013 08:36
Get types in OCaml
let _ =
let open Typedtree in
let open Types in
let types_from_arrow ty =
let rec helper ty =
match ty.desc with
| Tlink ty -> helper ty
| Tarrow (_, t1, t2, _) -> helper t1 @ helper t2
| Tconstr (Path.Pident id, _, _) -> [Ident.name id]
| _ -> failwith "oops" in
@jsyeo
jsyeo / Procfile
Last active August 29, 2015 14:05
Nginx Thin Clustered Mode Configuration
web: thin -C railsapp.yml start
@jsyeo
jsyeo / sec.csv
Last active August 29, 2015 14:08
Singapore Secondary Schools
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 52 columns, instead of 5 in line 2.
school,address,postal_code,lat,long,type,autonomous,sap,independent,aff,int,dual,exp,integrated_prog,dual_track,ib,co_ed,affiliation_pri,affiliation_jc,bus_services,mrt_station,express_min,express_max,na_min,na_max,nt_min,nt_max,aff_express_min,aff_express_max,aff_na_min,aff_na_max,aff_nt_min,aff_nt_max,ip_min,ip_max,express,na,nt,webpage,acad_type,text1,text2,text3,text4,text5,text6,text7,the_geom,cartodb_id,created_at,updated_at,the_geom_webmercator
Bedok South Secondary School,1 Jalan Langgar Bedok,468585,1.3248089,103.950977,Government,No,No,No,No,No,No,No,No,No,No,Co-ed,None,None,"2, 9, 10, 12, 14, 24,. 31, 35, 38, 45, 48",Tanah Merah,214,233,166,197,104,157,NA,NA,NA,NA,NA,NA,NA,NA,Yes,Yes,Yes,http://www.bedoksouthsec.moe.edu.sg,"Express, N(A), N(T)",Express: 214-233,N(A): 166-197,N(T): 104-157,,,,,0101000020E6100000E28FA2CEDCFC59401D322FD16A32F53F,16,2014-10-31T13:25:28Z,2014-10-31T13:25:28Z,0101000020110F000051A1773A47126641416B888F11010241
Bishan Park Secondary School,2 Sin Ming Walk,575565,1.364364,1
@jsyeo
jsyeo / Cargo.toml
Created May 15, 2015 08:59
Calling rust from ruby ffi
[package]
name = "double"
version = "0.1.0"
authors = ["Jason Yeo <[email protected]>"]
[lib]
name = "double"
crate-type = ["dylib"]
@jsyeo
jsyeo / README.md
Last active August 29, 2015 14:21 — forked from gavinbunney/README.md

Bamboo Plan Dashing Widget

Dashing widget to display plan build details from your Bamboo instance.

Preview

Bamboo Dashing Widget

Installation

@jsyeo
jsyeo / README.md
Last active February 28, 2021 18:32 — forked from jmb/README.md

Description

This is a fork of jmb's awesome widget that grabs the events with a private address instead of going through the tiresome process of Google's OAuth authentication.

Dashing widget to display the next and some subsequent Google Calendar events using the Google Calendar's private urls.

See the screenshot below

Installation

@jsyeo
jsyeo / py_eval.ex
Last active August 29, 2015 14:23
Concurrent Python Evaluator
defmodule PythonEvaluator do
@name :producer
def start(num_workers) do
consumer_pids = Enum.map(1..num_workers, fn _ -> PythonEvaluatorWorker.start end)
pid = spawn(__MODULE__, :loop, [consumer_pids])
:global.register_name(@name, pid)
pid
end
@jsyeo
jsyeo / keybase.md
Created July 21, 2015 00:14
Verifying myself on keybase

Keybase proof

I hereby claim:

  • I am jsyeo on github.
  • I am jsyeo (https://keybase.io/jsyeo) on keybase.
  • I have a public key whose fingerprint is 1174 83E3 1A6A 24ED BFC6 4D58 C2F3 6DAE 270D 2B8F

To claim this, I am signing this object:

@jsyeo
jsyeo / Main.java
Last active August 29, 2015 14:26
Class Hierarchy Analysis Example
public class Main {
public static void main(String[] args) {
H h = new H();
h.m();
// receiver has a declared class H, which is a subclass of C and H does not override method m
// therefore we are sure we are calling C.m here.
A a = new C();
a.m();
// We can be sure we are calling C.m here as A is never instantiated.
}
@jsyeo
jsyeo / interface.java
Created August 13, 2015 05:01
Interface Example for CHA
public class Main {
public static void main(String[] args) {
// write your code here
Interface i = new Implementer();
i.vulnerableMethod();
}
}
class Implementer implements Interface {
@Override