Skip to content

Instantly share code, notes, and snippets.

{
"AuctionStatus": {},
"IsVehiclePlateStolen": false,
"IsIllegalPlate": false,
"IsUnderReview": false,
"InquiryResult": {
"WasSuccessful": true,
"ErrorMessage": ""
},
"CustomerCase": {},
2015/08/07 16:17:02 on connection
2015/08/07 16:17:04 on disconnect
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x3374]
goroutine 13 [running]:
main.(*Connection).userAuthenticate(0xc208035dc0, 0xc2080d0500, 0xb, 0xc2080d0510, 0x9, 0x0, 0x0, 0x0, 0x0)
/Users/AndrewScala/go/src/github.com/gorilla/websocket/conn.go:566 +0x15c
github.com/gorilla/websocket.(*Conn).NextReader(0xc2080ca0f0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/AndrewScala/go/src/github.com/gorilla/websocket/conn.go:706 +0x7e
var seen_images = [...]
var process_image = function() { /* render */ };
var find_image = function(page_num, callback) {
$.get('url', {page: page_num}, function(image_list) {
var new_image_found = false;
for(var i = 0; i < image_list.length; ++i) {
if(seen_images.indexOf(image_list[i]) == -1) {
function process_image(image_data) {
}
function get_imgur_image(params, callback) {
$.get("imgur url", params, function(data) {
if(data === not what you're looking for) {
get_imgur_image(updated_params, callback);
}
else {
callback(data)
/** @jsx React.DOM */
var React = require('react');
var Store = require('./Store.js');
var actions = require('./actions.js');
var Cell = React.createClass({
getInitialState: function () {
console.log("Cell init")
return {
Ariel Pink's Haunted Graffiti - Only In My Dreams
Beach Fossils - What A Pleasure
Belle & Sebastian - Get Me Away From Here, I'm Dying
Best Coast - The Only Place
Deerhunter - Desire Lines
Diiv - Human
Dirty Gold - California Sunrise
Dom - Rude As Jude
Fools Gold - Surprise Hotel
Future Islands - Balance
"
" | |
" . , . . ,---. ,---| | ,---.
" \ / | | | | | | | |---'
" ' '---' ' ' `---' '--- `---
"
" -----------------------------------
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
@agscala
agscala / gist:6188347
Created August 8, 2013 20:24
Search directories for unused header files
import os
import re
from collections import defaultdict
# Directories to inspect all .h, .c, .cpp files inside
TARGET_DIRECTORIES = ["source", "include"]
def getfilepaths(target_directory):
all_files = []
@agscala
agscala / vine2gif.py
Created January 30, 2013 21:28
python vine2gif.py [vine_url] [output_file] Scrapes vine url, downloads video, and converts the file to a gif with mplayer
from pyquery import PyQuery as pq
import sys
import subprocess
import os
from urllib2 import urlopen, URLError, HTTPError
def convert(input_file, output_gif):
print "CONVERT", input_file, " => ", output_gif
subprocess.call(["mplayer", input_file, "-ao", "null", "-ss", "0:0:0", "-endpos", "6", "-vo", "gif89a:fps=8:output=%s" % output_gif, "-vf", "scale=240:180"])
from django.http import HttpResponseRedirect
def has_perm_or_redirect(permission, redirect):
def wrapper(function):
def wrapped_function(request, *args, **kwargs):
if request.user.has_perm("tpd4.NONE"):
print request.user.has_perm("blah")
return function(request, *args, **kwargs)
else:
return HttpResponseRedirect(redirect)