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
$('<script>', {src: '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js'}).appendTo('head'); | |
$(function(){ | |
var arr = []; | |
$('*').each(function(i, el){ | |
var classe = $(el).attr('class'); | |
if(classe && classe.length) { | |
arr.push(classe.split(' ')); | |
} | |
}); | |
arr = _(arr).sortBy(); |
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
// | |
// Grid system | |
// -------------------------------------------------- | |
//## Define your custom responsive grid. | |
//** Number of columns in the grid. | |
@grid-columns: 12; | |
//** Padding between columns. Gets divided in half for the left and right. |
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
{ | |
"backspace": "8", | |
"tab": "9", | |
"enter": "13", | |
"shift": "16", | |
"ctrl": "17", | |
"alt": "18", | |
"pause/break": "19", | |
"caps lock": "20", | |
"escape": "27", |
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
{ | |
"8": "backspace", | |
"9": "tab", | |
"13": "enter", | |
"16": "shift", | |
"17": "ctrl", | |
"18": "alt", | |
"19": "pause/break", | |
"20": "caps lock", | |
"27": "escape", |
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
`import Em from 'ember'` | |
equal = (args..., options) -> | |
arr = for arg in args | |
value = @get(arg) | |
if typeof value isnt 'undefined' then value else arg | |
method = if _.isEqual.apply(_, arr) then 'fn' else 'inverse' | |
return options[method](@) |
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
`import Ember from 'ember'` | |
oneormany = (length, value) -> | |
return "There are no #{value}s" if length is 0 | |
suffix = if length > 1 then 's' else '' | |
return "#{length} #{value}#{suffix}" | |
OneormanyHelper = Ember.Handlebars.helper 'oneormany', oneormany | |
`export { oneormany }` |
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
# hard to perfomance | |
className = getClassName(@) | |
newProto = {} | |
_(@__proto__).each((value, name) => | |
newProto[name] = do => | |
if typeof value is 'function' | |
return => | |
consoleMe = ['>>', [className, name].join('.')] | |
consoleMe.push '| call with', arguments if arguments.length > 0 | |
console.log.apply console, consoleMe |
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 findInArray(array, callback) { | |
for (var i = 0, element = array[i], length = array.length; i < length; i++) { | |
if (callback.apply(callback, [element, i, array])) return element; | |
} | |
} |
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
<% | |
$default_branch = 'master'; | |
$message = 'auto-commit'; | |
if (isset($_GET['message']) && $_GET['message'] != '') { | |
$message = $_GET['message']; | |
} | |
$message .= 'from ' . date("Y-m-d H:i:s") | |
$results = array(); |
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
start = 10 | |
maxV = 100000 | |
# --------------------------------------------- | |
begin = process.hrtime() | |
getRandom = (acc, max) -> | |
while acc.indexOf(random) isnt -1 | |
random = Math.floor(Math.random() * max) + 1 | |
random |
OlderNewer