Skip to content

Instantly share code, notes, and snippets.

View meandavejustice's full-sized avatar

Dave Justice meandavejustice

View GitHub Profile
comparator: function(item) {
return -item.get('number');
},
groupBy: function() {
if (item.isSubItem()) {
return [item.get('parent'), item.get('pk')];
} else {
return [item.get('pk'), 0];
@meandavejustice
meandavejustice / gist:7997704
Created December 17, 2013 00:21
create arr, add an attribute with dot notation. wat?
> var arr = []
undefined
> arr
[]
> arr.keyName = true
true
> arr
[ keyName: true ]
> arr[0]
undefined
@meandavejustice
meandavejustice / wtf.el
Created January 16, 2014 02:54
This function seems to be doing something weird when emacs is running in tmux. It makes `C-y` evaluate as 'mark set'. :(
;; normalize copy and paste for osx
(defun copy-from-osx ()
(shell-command-to-string "pbpaste"))
(defun paste-to-osx (text &optional push)
(let ((process-connection-type nil))
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
(process-send-string proc text)
(process-send-eof proc))))
(if (eq system-type 'darwin)
(progn
@meandavejustice
meandavejustice / gist:8461499
Created January 16, 2014 19:17
tourism in lynchburg
|11:12:32 meandavejustice | It's still weird to me that we live in a place that people visit on vacation │
│11:12:42 meandavejustice | that their are tourists here. │
│11:13:25 grantgarrett | thats what happens when you live in civilization │
│11:13:46 chrisforrette | meandavejustice: http://www.discoverlynchburg.org/ │
│11:14:07 chrisforrette | http://www.discoverlynchburg.org/wp-
@meandavejustice
meandavejustice / AMD
Created January 16, 2014 20:39
YAS Snippet for Require.js Modules
# -*- mode: snippet -*-
# name: amd
# --
define(function(require) {
/*
$0
*/
var $1 = $2({
$3
});
@meandavejustice
meandavejustice / ss.js
Created January 29, 2014 03:46
☠ ☮ ☯ Stupid Snippets ☯ ☮ ☠
/*
___
| | ___________
| | |____ ___|
\ \ | |
\ \ | |
| | | | | |
| | | | | |
|__| |___| |____|
import os
import subprocess
from flask import Flask, request, redirect, url_for, send_from_directory
from werkzeug import secure_filename, SharedDataMiddleware
from pydub import AudioSegment
DOWNLOAD_FOLDER = 'downloads/'
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = set(['mp3', 'mp4', 'wav', 'ogg', 'flac', 'gif'])
const PAGEGUIDES = {
'organizer': organizerGuideView,
'activity' : activityGuideView
};
loadViewName: function(viewName, opts) {
return PAGEGUIDES[viewName](opts);
}
@meandavejustice
meandavejustice / global-install.sh
Created February 25, 2014 22:14
Reads in a txt file of node-modules you want to globally install and installs them... globally.
#!/usr/bin/env bash
# Trap interrupts and exit instead of continuing the loop
trap "echo Exited!; exit;" SIGINT SIGTERM
while read line; do
npm install -g $line
done < ./global-modules.txt
@meandavejustice
meandavejustice / global-modules.txt
Created February 25, 2014 22:16
node-modules I like to have globally installed.
fuck-you
draft-dodger
pdx-shows
tweach
picture-tube
marked-man
n
node-inspector