Skip to content

Instantly share code, notes, and snippets.

View eculver's full-sized avatar
🧠
Braining

Evan Culver eculver

🧠
Braining
View GitHub Profile
{
"thumb": {
"href": "http://cache.mycdn.com/path/to/asset/a0324d3.jpg",
"width": 80,
"height": 80,
},
"asset": {
"id": 342393,
"title": "Client Commercial",
"filename": "mycommercial.m4v",
/**
* Example Module in RequireJS
define([
'common/js/models/user',
'common/js/models/event',
'myapp/js/player'
], function () {
Ember.Application.initializer(ret = {
@eculver
eculver / randhash
Last active August 29, 2015 13:57
One-liner to get a random character string for use in fixtures or mocking.
alias randhash='python -c "import md5; from datetime import datetime; print md5.new(datetime.now().strftime(\"%s\")).hexdigest()"'
@eculver
eculver / wd-grid-view-overrides.js
Last active August 29, 2015 13:57
Script to override Wiredrive Wordpress plugin's grid-view with larger images.
// create timeout to make sure it runs last
setTimeout(function () {
$(".wd-thumbnail").css('background-image', 'none').css({'width': 238, 'height': 144});
$(".wd-thumbnail img").css({'width': 238, 'height': 144}).show();
}, 200);
if ($parentId) {
$parentCondition = "node-closure.ancestor = $parentId";
$parentCondition = "node-closure.depth = 1";
} else if ($rootId) {
$parentCondition = "node-closure.ancestor = $rootId";
}
$clientCondition = "node.clientId = $clientId";
$assetCrit->addExpr('where', $parentCondition)
@eculver
eculver / command_t.sh
Last active August 29, 2015 14:00
Shell Notes: Install Command-T
# in .vimrc install w/ Vundle/Pathogen/etc
# Bundle "command-t"
# build the extension
cd ~/.vimrc/bundle/command-t/ruby/command-t
ruby extconf.rb
make
# restart vim
@eculver
eculver / keybase.md
Created August 15, 2014 01:57
Keybase proof

Keybase proof

I hereby claim:

  • I am eculver on github.
  • I am eculver (https://keybase.io/eculver) on keybase.
  • I have a public key whose fingerprint is 0A08 44A8 D6ED CCDD 4929 9BCD B530 10D9 1726 B005

To claim this, I am signing this object:

@eculver
eculver / custom-naming
Created September 2, 2014 05:34
Sickbeard Custom Naming Pattern
%SN/S%0S/%S.N-S%0SE%0E-%E.N
Sample:
Show Name/S02/Show.Name-S02E03-Ep.Name.ext
@eculver
eculver / .gitconfig
Created October 19, 2009 21:38
A sample ~/.gitconfig for coloring and other fanciness.
[alias]
st = status
diffstat = diff --stat -r
c = commit
co = checkout
[color]
ui = auto
[color "branch"]
function dumpProps(obj, parent) {
// Go through all the properties of the passed-in object
for (var i in obj) {
// if a parent (2nd parameter) was passed in, then use that to
// build the message. Message includes i (the object's property name)
// then the object's property value on a new line
if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
// Display the message. If the user clicks "OK", then continue. If they
// click "CANCEL" then quit this level of recursion
if (!confirm(msg)) { return; }