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
/** | |
* This is the original script that compelled me to make a modular version in order to be reusable | |
* - Repo: https://github.com/seantunwin/chardelay.js | |
* - View the project: http://seantunwin.github.io/chardelay.js | |
**/ | |
/* Set Array */ | |
var arr = [1,2,3,4]; | |
/* Create <p> element */ | |
var el = document.createElement('p'); |
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
/* This is a technique to lazy load your javascript files | |
* Handy for those pesky slow, load blocking off-site scripts | |
* function lazyLoad | |
* @s: String of path to file | |
*/ | |
function lazyLoad(s) { | |
var d = window.document, | |
b = d.body, /* appends at end of body, but you could use other methods to put where you want */ | |
e = d.createElement("script"); |
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
//find the middle of a line segment | |
@function get-middle($values...) { | |
$result: 0; | |
@each $value in $values { | |
$result: ($value / 2) + $result; | |
} | |
@return $result; | |
} |
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
{ | |
"auto_complete_commit_on_tab": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"file_exclude_patterns": | |
[ | |
"*.zip" | |
], | |
"font_face": "FantastiqueSansMono", | |
"font_size": 11, |
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
// Where @var exponent is less than or equal to 1 | |
// @return is @var num | |
function posPow(num, exponent) { | |
return num << ((exponent > 1) ? (exponent - 1) : 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
stat -c %a $file |
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
/** | |
* Convert slashes in DOS path strings to linux | |
* @use replace(/\\/g, '/') | |
* | |
* And | |
* | |
* Replace drive letter and colon with 'cygwin/' then the drive letter | |
* @use .replace(/^(\w):/i, 'cygwin/$1') | |
**/ | |
var dir = process.cwd().replace(/\\/g, '/').replace(/^(\w):/i, 'cygwin/$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
/** | |
* Create a pyramid | |
* @uses pyramid(<Number:Integer>) | |
* @var steps: [Number:Int] Number of pyramid steps | |
* @returns String | |
* | |
* @example: | |
* console.log(pyramid(6)); | |
* Outputs: | |
* # |
OlderNewer