Skip to content

Instantly share code, notes, and snippets.

@sglyon
sglyon / example.jl
Last active May 15, 2021 18:55
PlotlyJS.jl slider example
using PlotlyJS
# set up data
na = 10
nw = 5
zz = rand(1:4, na, nw, nw)
text = similar(zz, String)
text[zz .== 1] = "stay, work"
text[zz .== 2] = "move, work"
@sglyon
sglyon / showtime.jl
Created April 5, 2017 17:13
showtime macros
macro showtime(ex)
blk = Expr(:block)
push!(blk.args, :(println($(sprint(Base.show_unquoted,ex)*" = "),
repr(begin value=$(esc(ex)) end))))
push!(blk.args, :value)
quote
local stats = Base.gc_num()
local elapsedtime = Base.time_ns()
@sglyon
sglyon / wunderlist2todoist.py
Created January 2, 2017 17:15
wunderlist -> todoist -- super ugly, but got the job done for me.
import json
import os
import time
from collections import OrderedDict
from contextlib import contextmanager
import wunderpy2
import todoist
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sglyon
sglyon / SHA_8aa5b35.txt
Created September 8, 2016 13:47
dolo.jl ea_quest3.mod import benchmarks
Benchmark for build_levels_func_body:
BenchmarkTools.Trial:
samples: 10000
evals/sample: 1
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 277.17 kb
allocs estimate: 4695
minimum time: 394.74 μs (0.00% GC)
median time: 431.94 μs (0.00% GC)
@sglyon
sglyon / Jiahao_horizontal_bar.ipynb
Last active July 28, 2016 20:59
Jiahao horizontal bar
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sglyon
sglyon / MyTypes.jl
Last active May 23, 2016 22:08
julia relative modules
module MyTypes
export TheParent
abstract TheParent
Base.show(io::IO, p::TheParent) = println(io, "Some instance of TheParent")
end # module
@sglyon
sglyon / testing_comm.ipynb
Created May 16, 2016 11:21
plotly+ijulia comm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.