This file contains hidden or 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
module.exports = (grunt) -> | |
grunt.initConfig | |
appDir: "./app" | |
srcDir: "<%= appDir %>/src" | |
contentDir: "<%= appDir %>/content" | |
templateDir: "<%= appDir %>/templates" | |
vendorDir: "<%= appDir %>/vendor" | |
cssDir: "<%= appDir %>/stylesheets" | |
testDir: "./test" | |
This file contains hidden or 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 Prime() { | |
this.prime = 1; | |
} | |
Prime.prototype.isPrime = function(num) { | |
var result = true, maxToCheck = Math.ceil(Math.sqrt(num)); // integer number comparison is faster | |
if (num & 1) { // if odd number | |
for (var f = 3; f <= maxToCheck; f += 2) { | |
if (!(result = !!(num % f))) return false; |
This file contains hidden or 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
/* | |
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* |
This file contains hidden or 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
module.exports = function (grunt) { | |
'use strict'; | |
grunt.initConfig({ | |
pkg : grunt.file.readJSON("package.json"), | |
meta : { | |
js : [ | |
'js/*.js', | |
'lib/*.js' | |
], |
This file contains hidden or 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() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
This file contains hidden or 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
#!/usr/bin/env sh | |
repo=$( echo $1 | sed -E 's/^.*\///' | sed -E 's/\.git//' ) | |
echo "\n<<<<<<<<< Cloning [${repo}] from [${1}] >>>>>>>>>" | |
T1=$(date +%s) | |
git clone $1 && cd $repo | |
HEAD=$( git rev-parse --abbrev-ref HEAD ) |
This file contains hidden or 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
#!/usr/bin/env sh | |
push=0 | |
if [[ $# -eq 1 && $1 -eq '-f' ]]; then | |
push=1 | |
fi | |
T1=$(date +%s) | |
cwd=$(pwd) |
This file contains hidden or 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 Y(f) { | |
var g = function(h) { | |
return function(x) { | |
return f(h(h))(x); | |
}; | |
}; | |
return g(g); | |
} |
This file contains hidden or 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
# PROMPT=' | |
# %{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$(put_spacing)%}%{$fg[cyan]%}%{$(git_prompt_info)%} | |
# %{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}' | |
PROMPT=' | |
%{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$fg[cyan]%}%{$(git_prompt_info)%} | |
%{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}' | |
function get_pwd() { | |
echo "${PWD/$HOME/~}" |
This file contains hidden or 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 () { | |
'use strict'; | |
var DEFAULT_MAX_DEPTH = 6; | |
var DEFAULT_ARRAY_MAX_LENGTH = 50; | |
var seen; // Same variable used for all stringifications | |
Date.prototype.toPrunedJSON = Date.prototype.toJSON; | |
String.prototype.toPrunedJSON = String.prototype.toJSON; |
OlderNewer