Skip to content

Instantly share code, notes, and snippets.

View meandavejustice's full-sized avatar

Dave Justice meandavejustice

View GitHub Profile
@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 / 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 / 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: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
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];
// currently sorting my collection with this comparator.
// It sets up a relationship so that a Parent Item should be before its sub-items(you can think of these as sub tasks)
// 'parent' attribute is just the 'pk' of the parent item.
// This is working fantastically but I need to sort at a higher level above this descending from an attribute called
// 'created_at'.
// the `else` refers to items that are either parents, or items that have no relationship to any others.
comparator: function(item) {
if (item.isSubItem()) {
return [item.get('parent'), item.get('pk')];
// Bohemian Rhapsody - queen
if (realLife || fantasy) {
for (i = 0; i < landslide + 1; i++) {
if (!reality) {
break;
}
landslide = i + 1;
}
}
@meandavejustice
meandavejustice / placeholder-mixin.less
Created October 23, 2013 22:40
a mixin for styling html placeholders
// placeholder styles
.placeholder(@color:inherit, @background: inherit) {
::-webkit-input-placeholder {
color: @color;
background: @background;
}
:-moz-placeholder { /* Firefox 18- */
color: @color;
background: @background;
@meandavejustice
meandavejustice / gist:7091347
Last active December 26, 2015 04:09
my current .emacs
(load-theme 'kvn-spacey t)
(require 'package)
;; Add the original Emacs Lisp Package Archive
(add-to-list 'package-archives
'("elpa" . "http://tromey.com/elpa/"))
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
npm WARN package.json Please pick one as the 'repository' field