Skip to content

Instantly share code, notes, and snippets.

Joshua Kehn joshkehn

Block or report user

Report or block joshkehn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View queue.py
# (c) 2017 Joshua Kehn, all rights reserved.
class Node(object):
def __init__(self, val=None):
self.val = val
self.next = None
class QueueException(Exception):
pass
@joshkehn
joshkehn / dataisbeautiful.csv
Last active Apr 18, 2018
Posts from /r/dataisbeautiful as of 2017-09-03
View dataisbeautiful.csv
We can't make this file beautiful and searchable because it's too large.
"created","post","score","comments","oc","author","title"
"2017-09-03T20:38:25","6xwz6r","1","0","TRUE","WhosaWhatsa","2017 YTD U.S. Feature Film Release with Most IMDB Votes [OC]"
"2017-09-03T19:58:32","6xwrh3","4","4","TRUE","_HexMan","Police Shootings since January 1, 2015 [OC]"
"2017-09-03T18:44:34","6xwdcp","1","1","TRUE","potato_pototo","Average Indian movie length by language[OC]"
"2017-09-03T18:37:12","6xwbxp","3","2","TRUE","seis-matters","Recordings of Five North Korea Nuclear Tests [OC]"
"2017-09-03T18:22:33","6xw8z7","5","1","FALSE","pecanpiecat","The worth of $100 by state"
"2017-09-03T17:43:34","6xw0t5","2","1","TRUE","wisequokka","Time series seismic data of the North Korean H-bomb test [OC]"
"2017-09-03T17:30:03","6xvxyi","0","0","FALSE","thevizinista","Floral Designer"
"2017-09-03T15:41:26","6xva9b","1","2","TRUE","Living_Granger","Capital punishment since 1991: Number of executioners and abolitionist countries. [OC]"
"2017-09-03T15:17:27","6xv56f","0","0","FALSE","d0mth0ma5","North Korean tr
View file
say "Talking with images is boring"
View force_touch.html
<pre id="forcelog">Waiting for force touch...</pre>
<div id="forceclick">&#x261e;</div>
<style type="text/css">
#forcelog { font-family: "Source Code Pro", Consolas, Monaco, "Andale Mono", "Lucida Sans Typewriter", Courier, "Courier New", monospace; }
#forceclick { display: block; width: 50%; padding: 10px; margin: 1em auto; background: gray; color: white; text-align: center; font-size: 3em; line-height: 3em; }
#forceclick[mouse-down] { background: red; }
#forceclick[force-down] { background: green; }
</style>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
View sauce.md

Ingredients

  • 1-2 onions diced
  • Garlic (as much as you'd like)
  • Fresh tomatoes (quartered, remove skins if you like)
  • Diced tomatoes (canned)
  • Tomato paste (one tube / small can)
  • Fresh basil

Steps

View gist:e48aa942bcf2c5494014
## Ingredients
- 1-2 onions diced
- Garlic (as much as you'd like)
- Fresh tomatoes (quartered, remove skins if you like)
- Diced tomatoes (canned)
- Tomato paste (one tube / small can)
- Fresh basil
## Steps
@joshkehn
joshkehn / preload-example.css
Created Feb 11, 2014
CSS background image preloading without JavaScript. Includes LESS mixin.
View preload-example.css
.arrow {
background: url("../images/arrow-normal.svg") no-repeat top center;
}
.arrow:before {
background: url("../images/arrow-hover.svg");
display: none;
}
.arrow:hover {
background: url("../images/arrow-hover.svg");
}
View views.py
def some_view (request):
# Could substitute `None` with some other default value
key = request.POST.get("key", None)
return render(request, "mytemplate.html", {"key": key})
# In mytemplate.html you'll now have `key` available with whatever was submitted via the form. Note
# that there is NO validation here, you should probably be using a form to capture the input,
# validate it, and return it. https://docs.djangoproject.com/en/dev/ref/forms/api/
You can’t perform that action at this time.