This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Untitled</title> | |
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css"> | |
<link rel="stylesheet" type="text/css" href="main.css"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Override Vim Bindings for Colemak | |
'.editor.vim-mode:not(.command-mode)': | |
'cmd-k': 'vim-mode:activate-command-mode' | |
'cmd-shift-k': 'vim-mode:activate-command-mode' | |
'cmd-h': 'core:move-left' | |
'cmd-i': 'core:move-right' | |
'cmd-e': 'core:move-up' | |
'cmd-n': 'core:move-down' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.html': | |
'Template Tag': | |
'prefix': 'tp' | |
'body': '<template name="$1" id="$1">\n\t$2\n</template>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parseTweet = function(tweetText) { | |
var reghash, reguri, regusername; | |
reguri = /(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/=]*))/g; | |
regusername = /([@]+([A-Za-z0-9-_]+))/g; | |
reghash = /[#]+([A-Za-z0-9-_]+)/g; | |
tweetText = tweetText.replace(reguri, "<a href='$1' target='_blank'>$1</a>"); | |
tweetText = tweetText.replace(regusername, "<a href='http://twitter.com/$2' target='_blank'>$1</a>"); | |
tweetText = tweetText.replace(reghash, "<a href='http://twitter.com/search?q=%23$1' target='_blank'>#$1</a>"); | |
return tweetText; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('...', function(req, res){ | |
var lines = [...]; | |
var lineFns = lines.map(function(line){ | |
return function(cbLines){ | |
var words = line.split(' '); | |
var wordFns = words.map(function(word){ | |
return function(cbWords){ | |
Model.find({term: word}, function(err, docs){ | |
if(docs.length === 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
var ${2:${1/.*\/([^\.]+)[\.]?(.*)/$1/g}} = require('${1:lib}'); | |
]]></content> | |
<tabTrigger>req</tabTrigger> | |
<scope>source.js</scope> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ArrayAddition(arr) { | |
// calculate the largest possible number | |
var startArr = arr.sort(function(a,b){return b-a}); | |
var largest = startArr.shift(); | |
// return true if the current total plus any number is | |
// the largest option | |
var checker = function(curArr, curTotal){ | |
// Go through each item in the current set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
// movement in command mode | |
// up | |
{ | |
"keys": ["e"], | |
"command": "set_motion", | |
"args": { | |
"motion": "move", | |
"motion_args": {"by": "lines", "extend": true, "forward": false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// STRING FUNCTIONS | |
console.log('----- STRINGS -----'); | |
// indexOf( substr ) | |
// return -1 if not found | |
// return index of string found | |
console.log('String indexOf:', 'hello world'.indexOf('l') ); | |
// ^ String indexOf: 2 | |
console.log('String indexOf:', 'hello world'.indexOf('nope') ); | |
// ^ String indexOf: -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getReps = function(str){ | |
return _.chain(str.split(' ')) | |
.map(function(w){ | |
return { | |
word: w, | |
reps: _.chain(w.toUpperCase().split('')) | |
.groupBy(_.identity) | |
.max(function(g){ | |
return g.length; | |
}) |
OlderNewer