Skip to content

Instantly share code, notes, and snippets.

@jpellerin
jpellerin / cwe.cr
Created July 13, 2015 15:46
crystal web scratch
require "http/server"
require "./cwe/*"
module Cwe
class Route
getter callback
PARAM = /:([\w\d_]+)/
def initialize(@path, @callback : HTTP::Request -> _)
@jpellerin
jpellerin / gist:c8a45d3ad90ad0b779eb
Created April 9, 2015 03:39
func param evaluation
>>> import datetime
>>> def hello(date=datetime.datetime.now()):
... print date
... print datetime.datetime.now()
...
>>> hello()
2015-04-08 20:38:06.231901
2015-04-08 20:38:12.647230
>>> hello()
2015-04-08 20:38:06.231901

Keybase proof

I hereby claim:

  • I am jpellerin on github.
  • I am jpellerin (https://keybase.io/jpellerin) on keybase.
  • I have a public key whose fingerprint is 280C EE9B 4E77 306D 2453 B567 423C D64D BEE0 8BEE

To claim this, I am signing this object:

@jpellerin
jpellerin / example.html
Last active December 20, 2015 12:39
Mustache-like syntax for knockoutjs (3.0 or better), based on http://blog.stevensanderson.com/2013/07/09/knockout-v2-3-0-released-v3-0-0-beta-available/
<html>
<head>
<style>
.goo { font-family: sans-serif; }
.boo { color: #999 };
</style>
</head>
<body>
<ol class="{{ things }} listy {{ stuff }}">
{{#people}}
@jpellerin
jpellerin / books.txt
Last active December 15, 2015 15:59
Things I've read recently and liked
Upcoming releases!
Scott Lynch - Republic of Thieves - 10/8
Recent
Guy Gavriel Kay - Sailing to Sarantium - 9
Cat Valente - Six Gun Snow White - 10
Lev Grossman - The Magicians - 7
@jpellerin
jpellerin / gist:2399484
Created April 16, 2012 15:30
totally untested decorator swap plugin
## the plugin
from nose.plugins import Plugin
import thedecorators
import thingtwo
class Swapper(Plugin):
enableOpt = 'swap'
@jpellerin
jpellerin / subprocess_stdout.patch
Created December 14, 2011 18:40
issue #6/#290 patch
diff -r fda1e996260d nose/ext/dtcompat.py
--- a/nose/ext/dtcompat.py Tue May 05 19:22:53 2009 -0400
+++ b/nose/ext/dtcompat.py Mon Sep 07 17:25:13 2009 -0700
@@ -247,6 +247,8 @@
# Override some StringIO methods.
class _SpoofOut(StringIO):
+ fileno = lambda self : 1
+
def getvalue(self):
@jpellerin
jpellerin / doctests.py.patch
Created December 14, 2011 16:32
issue #7/#306 patch
diff -r 34c6847853b7 nose/plugins/doctests.py
--- a/nose/plugins/doctests.py Fri Oct 09 18:40:28 2009 -0500
+++ b/nose/plugins/doctests.py Wed Nov 11 20:57:51 2009 -0700
@@ -170,6 +170,11 @@
help="Find fixtures for a doctest file in module "
"with this name appended to the base name "
"of the doctest file")
+ parser.add_option('--doctest-options', action="append",
+ dest="doctestOptions",
+ metavar="OPTIONS",