Skip to content

Instantly share code, notes, and snippets.

View daytonn's full-sized avatar
💀
Trying to figure out why I would care to add a status to github

Dayton Nolan daytonn

💀
Trying to figure out why I would care to add a status to github
View GitHub Profile
@daytonn
daytonn / teaspoon-spec_helper.js
Created November 22, 2014 16:31
Teaspoon spec_helper.js example
//= require jquery
//= require support/expect
//= require support/sinon
//= require support/chai
//= require support/chai-jquery
//= require support/sinon-chai
//= require magic_lamp
//= require lodash
//= require application
//= require_self
@daytonn
daytonn / Default (OSX).sublime-keymap
Last active August 29, 2015 14:05
Sublime Keymap
[
// Cursor Movement
// ⌃F Forward by words
{ "keys": ["alt+f"], "command": "move", "args": { "by": "wordends", "forward": true } },
// ⌃B Backward by words
{ "keys": ["alt+b"], "command": "move", "args": { "by": "words", "forward": false } },
// ⌃A Beginning of line (soft)
{ "keys": ["ctrl+a"], "command": "move_to", "args": { "to": "bol" } },
@daytonn
daytonn / readline_fixes.json
Last active August 29, 2015 14:05
Readline fixes for sublime
// Readline style toggle comment
{ "keys": ["ctrl+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
// Readline fix select line up
{ "keys": ["ctrl+shift+p"], "command": "move", "args": { "by": "lines", "forward": false, "extend": true } },
// Readline fix by word ends
{ "keys": ["alt+f"], "command": "move", "args": { "by": "word_ends", "forward": true } },
{ "keys": ["alt+b"], "command": "move", "args": { "by": "word_ends", "forward": false } },
// Readline fix select by word ends
{ "keys": ["shift+alt+b"], "command": "move", "args": { "by": "word_ends", "forward": false, "extend": true } },
{ "keys": ["shift+alt+f"], "command": "move", "args": { "by": "word_ends", "forward": true, "extend": true } },
@daytonn
daytonn / fake-api-server.js
Created April 11, 2014 14:55
OpenBadges Fake API
(function() {
FakeAPI = {
users: [
{
id: 1,
user: "user@example.com",
badges: _.times(5, function(i) {
var id = i + 1;
return {
id: id,
@daytonn
daytonn / .colors
Created January 28, 2014 21:50
Bash Color functions
# Colors
end="\033[0m"
black="\033[0;30m"
blackb="\033[1;30m"
white="\033[0;37m"
whiteb="\033[1;37m"
red="\033[0;31m"
redb="\033[1;31m"
green="\033[0;32m"
greenb="\033[1;32m"
@daytonn
daytonn / bindAll.js
Created November 26, 2013 19:33
bind all implementation
var obj = {
id: 1,
whoami: function() {
return this.id;
}
};
function callExternally(callback) {
this.id = 99;
return callback();
@daytonn
daytonn / spec_helper.js
Last active December 22, 2015 13:19
Custom jasmine matchers
beforeEach(function() {
this.addMatchers({
toBeTrue: function() {
return this.actual === true;
},
toBeFalse: function() {
return this.actual === false;
},
@daytonn
daytonn / composed_event_callback_handler.js
Created July 1, 2013 15:31
Composed event callback handler
function togglePanel() {
$(".panel").slideToggle();
}
function doOtherStuff() {
// other stuff is done here
}
function handleArrowClick() {
togglePanel();
@daytonn
daytonn / named_on_callback.js
Created July 1, 2013 15:27
Named callback using on event method
function togglePanel() {
$(".panel").slideToggle();
}
$('.arrow').on('click', togglePanel);
@daytonn
daytonn / named_callback.js
Created July 1, 2013 15:24
Named event callback
function togglePanel() {
$(".panel").slideToggle();
}
$('.arrow').click(togglePanel);