Skip to content

Instantly share code, notes, and snippets.

View emidln's full-sized avatar

Brandon Adams emidln

  • Chicago, IL
View GitHub Profile
@emidln
emidln / sexp_query.py
Created June 8, 2012 21:33
django boolean querying api from json
# this is still missing error handling
# it's very convenient to convert json arrays into python lists letting javascript clients
# get powerful querying
# if you wrap up the full message with something like a meta field to include options
# for limiting, offsetting, format, orderying, sorting, etc, you have a full-blown
# mini api with powerful querying
# the else part of evaluate should be a function and should provide a callback so that
# certain filter_names or data types can be controlled better
import operator
import ctypes
import scrypt
# This only supports OSX right now:
libc = ctypes.CDLL('libc.dylib')
SCRYPT_MAXTIME = 0.5
#!/bin/bash
set -x
#
# Grab verified boot utilities from ChromeOS.
#
mkdir -p /usr/share/vboot
mount -o ro /dev/sda3 /mnt
cp /mnt/usr/bin/vbutil_* /usr/bin
--- common/CMakeLists.txt 2013-05-10 23:56:14.290279120 -0400
+++ common/CMakeLists.txt 2013-05-10 23:55:53.326241934 -0400
@@ -39,6 +39,7 @@
FIND_PACKAGE(Qt4 REQUIRED)
FIND_PACKAGE(Protobuf REQUIRED)
+FIND_PACKAGE(Threads REQUIRED)
QT4_WRAP_CPP(common_HEADERS_MOC ${common_HEADERS})
INCLUDE(${QT_USE_FILE})
@emidln
emidln / gist:5734125
Last active December 18, 2015 05:39
nosetests --verbosity=3 output without django
Failure: ImportError (No module named django.conf) ... ERROR
...
<snip>
...
======================================================================
ERROR: Failure: ImportError (No module named django.conf)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/bja/code/elasticutils/env/lib/python2.7/site-packages/nose/loader.py", line 413, in loadTestsFromName
addr.filename, addr.module)
@emidln
emidln / pr.md
Created June 22, 2013 21:06 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 11
},
"objects": [
{
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 11
},
"objects": [
{
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 11
},
"objects": [
{
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 11
},
"objects": [
{