- Monads and Gonads
- Crockford on JavaScript - Act III: Function the Ultimate
- Which way is forward - Douglas Crockford
- Crockford on JavaScript - Scene 6: Loopage
- Douglas Crockford: Principles of Security
- Douglas Crockford: Programming Style & Your Brain
- Which way is forward - Douglas Crockford
- Crock's Corner: ES5 The New Parts
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
/** | |
* A recursive function to parse a multidimensional array from a string | |
* | |
* @param array $delimiter Array of delimiters | |
* @param string $string The string to parse | |
* @return array Multidimensional array | |
*/ | |
function n26_multi_explode(array $delimiter, $string) { | |
// Shift the array | |
$d = array_shift($delimiter); |
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
A recursive function to parse a multidimensional array from a string |
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
'use strict'; | |
define(function () { | |
var substitute = {}; | |
substitute.placeholders = function (target, replaceObject) { | |
_replaceStuff(target, replaceObject, 'placeholders'); | |
}; | |
substitute.attribute = function (target, replaceObject) { |
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
/** | |
* Call an API | |
* | |
* @param string $method HTTP verb: POST, PUT, GET etc | |
* @param stinrg $url URL | |
* @param boolean $data Plunk the data tot he URL: array("param" => "value") ==> index.php?param=value | |
* @return request Whatever the API returns | |
*/ | |
function n26_call_api($method, $url, $data = false) { | |
$curl = curl_init(); |
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
// ---- | |
// z-index mixin to help organize z-indexes | |
// ---- | |
// Start with a map | |
$z-layers: ( | |
"cog": 50, | |
"overlay": 40, | |
"toc": 30, | |
"iframe-loader": 25, |
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
linters: | |
SelectorFormat: | |
enabled: true | |
convention: strict_BEM | |
Indentation: | |
enabled: true | |
width: 4 | |
ColorKeyword: |
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
/** | |
* Use the browsers native capability to escape strings | |
*/ | |
'use strict'; | |
define(function() { | |
// Use the browser's built-in functionality to quickly and safely escape the | |
// string | |
return function(str) { | |
var div = document.createElement('div'); | |
div.appendChild(document.createTextNode(str)); |
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
'use strict'; | |
define(function() { | |
/** | |
* Returns a function, that, as long as it continues to be invoked, will not | |
* be triggered. The function will be called after it stops being called for | |
* N milliseconds. If `immediate` is passed, trigger the function on the | |
* leading edge, instead of the trailing. | |
*/ | |
var debounce = function(func, wait, immediate) { | |
var timeout; |
NewerOlder