Skip to content

Instantly share code, notes, and snippets.

View aconz2's full-sized avatar

Andrew Consroe aconz2

View GitHub Profile
@aconz2
aconz2 / font_stacks_stylus
Last active December 11, 2015 01:58
Stylus variables of css font stacks, grabbed from http://css-tricks.com/snippets/css/font-stacks/
/* Times New Roman-based stack */
$timesNewRoman = Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif
/* Modern Georgia-based serif stack */
$modernGeorgia = Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif
/* Traditional Garamond-based serif stack */
$garamond = "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif
/* Helvetica/Arial-based sans serif stack */

List of components to remember

DOM

component/query component/classes component/value

DOM Events

Simple

@aconz2
aconz2 / component-emitter
Created September 9, 2013 01:01
weird bug with component install, happens only sometimes, and happens to the following files a lot, always at the bottom
/**
* Expose `Emitter`.
*/
module.exports = Emitter;
/**
* Initialize a new `Emitter`.
*
* @api public
@aconz2
aconz2 / get_all_pip_packages.py
Created June 14, 2015 23:54
Retreive a list of all available packages from pip. (pip(1) doesn't output in a nice format)
#!/usr/bin/env python3
import pip
searcher = pip.commands.SearchCommand()
options, _ = searcher.parse_args([])
hits = searcher.search('*', options)
hits_transformed = pip.commands.search.transform_hits(hits)
for hit in hits_transformed:
print(hit['name'])
@aconz2
aconz2 / many_plots.py
Created September 17, 2015 17:50
Iterate through a series of matplotlib plots, waiting for keyboard input (from the terminal)
import numpy as np
from matplotlib import pyplot as plt
plt.ion()
# say you have a bunch of distributions you'd like to look at
data_sets = [np.random.poisson(lam, size=100), for lam in np.random.randint(1, 100, size=10)]
# in a REPL, this one-liner makes it easy to plot each one successively waiting for ENTER from the terminal
_ = [[plt.hist(data), input()] for data in data_sets]
@aconz2
aconz2 / xor.py
Created September 24, 2015 22:04
3D plot of making a 2D non-linearly-seperable problem (XOR) into a 3D linearly seperable one with feature mapping.
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# original data
# not linearly separable in 2D
x = np.array([[1, 1], [-1, -1], [-1, 1], [1, -1]])
@aconz2
aconz2 / perceptron.py
Created September 26, 2015 22:27
visualize the perceptron weight vector changing over training examples
#!/usr/bin/env python3
from matplotlib import pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
normed = lambda v: v / np.linalg.norm(v)
# orthogonal vector in 2 space
orthogonal = lambda v: np.cross(v, [0, 0, 1])[:2]
pltvec = lambda v, **kwargs: plt.plot([0, v[0]], [0, v[1]], **kwargs)
@aconz2
aconz2 / a.ml
Created October 1, 2015 02:29
question about type systems
type exp =
| Int of int
| Succ of exp
(* This is what we want to write: *)
(* let rec step (e : exp) : exp option = *)
(* match e with *)
(* | Int _ -> None *)
(* | Succ (Int i) -> Some (Int (i + 1)) *)
(* | Succ e -> Some (Succ (step e)) *)
@aconz2
aconz2 / a_gen.ml
Created October 1, 2015 17:32
trying to write polymorphic type generators in ocaml
type exp =
| Int of int
| Succ of exp
| Plus of exp * exp
(* realistically we would want to specify depth and/or the bias of
choosing a certain expression *)
let rec gen_exp () : exp =
match Random.int 3 with
| 0 -> Int (Random.int 42)
using CUDA on GPU 0...
Make sure that your saved checkpoint was also trained with GPU. If it was trained with CPU use -gpuid -1 for sampling as well
creating an lstm...
missing seed text, using uniform probability over first character
--------------------------
�y job is producing how people read out there. Our platform builds a core technology startup is established by hardest lifestal search and data structures and allowing us to be family on all shapes and shape some of the developers, including MacBook profiles, mongotiout and test achieved as the time to distribute the code. If you have any questions about all of our jobs page for more information to about us really among the latter to contribute to person because it's a very larger hands to do the intersection that lesss more varied or email me (http://blog.vittualsnownup.org/wiki/) – Full-Time, , Canada, Remote, Perl, POS, (or JavaScript (UI/UX)TEDY is a number of hiring software developers who are excited about technical hires to be quickly as th