Skip to content

Instantly share code, notes, and snippets.

View jasongrout's full-sized avatar

Jason Grout jasongrout

View GitHub Profile
@jasongrout
jasongrout / esIterTest.js
Last active April 26, 2018 15:58 — forked from sccolbert/esIterTest.js
Undefined compare slow in Firefox
// Interestingly, the compare with undefined below is about ~10x slower than the typeof compare in Firefox.
// See this by running myTiming() and myTimingUndefinedCompare()
class MyArrayIterator {
constructor(source) {
this._index = 0;
this._source = source;
}
#!/bin/sh
set -e
gh="https://github.com/"
repos="
ipython/traitlets
ipython/ipython
jupyter/jupyter_core
<!-- put this in the header-->
<script src='http://sagecell.sagemath.org/static/jquery.min.js'/>
<script src='http://sagecell.sagemath.org/static/embedded_sagecell.js'/>
<link href='http://sagecell.sagemath.org/static/sagecell_embed.css' rel='stylesheet' type='text/css'/>
<!-- put this in the body where you want a cell. adjust your inputs, of course. -->
<div class="sage">
<script type="text/x-sage">
1+2
</script></div>
<!-- put this in the header-->
<script src='http://sagecell.sagemath.org/static/jquery.min.js'/>
<script src='http://sagecell.sagemath.org/static/embedded_sagecell.js'/>
<link href='http://sagecell.sagemath.org/static/sagecell_embed.css' rel='stylesheet' type='text/css'/>
<script>$(function () { sagecell.makeSagecell({&quot;inputLocation&quot;: &quot;.sage&quot;}) });</script>
<!-- put this in the body where you want a cell. adjust your inputs, of course. -->
<div class="sage">
<script type="text/x-sage">
@jasongrout
jasongrout / example.py
Created October 11, 2012 22:12 — forked from mdboom/serve_figure.py
Proof of concept code for serving interactive matplotlib figures to the webbrowser
import serve_figure
import numpy as np
from numpy import ma
from matplotlib import pyplot as plt
n = 12
x = np.linspace(-1.5,1.5,n)
y = np.linspace(-1.5,1.5,n*2)
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
# Load a sparse matrix.
import numpy as np
from scipy import sparse
def mymethod():
print 'hi'
def load_sparse(filename, dtype=np.float32):
with file(filename) as input:
<html>
<head>
<title>test</title>
</head>
<body>
<h1>testing gist again</h1>
<script src="http://gist.github.com/3806.js"></script>
</body>
</html>