Skip to content

Instantly share code, notes, and snippets.

View mikewaters's full-sized avatar

Mike Waters mikewaters

  • Dealertrack
View GitHub Profile
@mikewaters
mikewaters / human_enum.py
Created February 29, 2012 19:20 — forked from anthonywu/human_enum.py
Python Human Enums
"""
Copyright (c) 2012 Anthony Wu, twitter.com/anthonywu
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@mikewaters
mikewaters / gist:1287749
Created October 14, 2011 17:29
Add a submit button to Flexigrid quicksearch bar.
*** flexigrid.js.orig 2011-10-14 13:25:31.162849505 -0400
--- flexigrid.js 2011-10-14 13:24:35.582840402 -0400
***************
*** 1034,1040 ****
}
$(g.sDiv).append("<div class='sDiv2'>" + p.findtext +
" <input type='text' value='" + p.query +"' size='30' name='q' class='qsbox' /> "+
! " <select name='qtype'>" + sopt + "</select></div>");
//Split into separate selectors because of bug in jQuery 1.3.2
$('input[name=q]', g.sDiv).keydown(function (e) {
@mikewaters
mikewaters / gist:1219800
Created September 15, 2011 17:01
Typhoeus x86_64 Debian curl linker patch
+++ /usr/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/ext/typhoeus/extconf.rb 2011-09-15 16:39:01.000000000 +0000
--- /usr/lib/ruby/gems/1.8/gems/typhoeus-0.2.4/ext/typhoeus/extconf.rb.old 2011-09-15 16:58:08.000000000 +0000
@@ -58,7 +58,6 @@
LIBDIR,
'/opt/local/lib',
'/usr/local/lib',
+ '/usr/lib/x86_64-linux-gnu',
'/usr/lib'
)
end
@mikewaters
mikewaters / gist:1204741
Created September 8, 2011 21:11
Custom nodes
# My Custom Nodes
#
# in nodes/field_nodes.py
class FunctionSubstituteNode(base.Node):
"""Manipulate a field using a function.
This is a simpler version of DeriveNode(); a single field is passed in
rather than the entire record.
"""
__node_info__ = {