controller: page-specific
model: if the business object as a canonical representation
helpers, components: generic configurable elements
| function toArray(args) { | |
| return [].slice.call(args); | |
| } | |
| function sub_curry(fn /*, variable number of args */) { | |
| var args = [].slice.call(arguments, 1); | |
| return function () { | |
| return fn.apply(this, args.concat(toArray(arguments))); | |
| }; | |
| } |
| /** | |
| Placeholder - Contains all static mixin name value pairs for a particular mixin | |
| */ | |
| %box { | |
| border: 1px solid; | |
| padding: 1em; | |
| margin: 1em; | |
| } | |
| /** |
| # Convert the following liquid tags into output wrapped with <code class="inline-code"> ... </code> | |
| # 1. {% i %} var foo="bar"; {% ei %} | |
| # 2. {% inline %} var foo="bar"; {% endinline %} | |
| module Jekyll | |
| class SyntaxHighlightInlineTag < Liquid::Tag | |
| def render(context) | |
| '<code class="inline-code">' | |
| end | |
| end |
| /** | |
| Intl.DateTimeFormat().resolvedOptions() | |
| Object {locale: "en-US", numberingSystem: "latn", calendar: "gregory", timeZone: "America/New_York", year: "numeric"…} | |
| calendar: "gregory" | |
| day: "numeric" | |
| locale: "en-US" | |
| month: "numeric" | |
| numberingSystem: "latn" | |
| timeZone: "America/New_York" |
controller: page-specific
model: if the business object as a canonical representation
helpers, components: generic configurable elements
| /** | |
| Readme | |
| 1. Copy & paste the input file into third-party.css as raw CSS | |
| 2. $ node css-negator.js | |
| 3. When finished, the final copy will be in the file named: negated-output.css | |
| */ | |
| var css = require('css'); | |
| var fs = require('fs'); | |
| var colors = require('colors'); |
| /* | |
| Double every consonant and place an occurrence of "o" in between. | |
| For example, translate("this is fun") should return the string "tothohisos isos fofunon". | |
| translate('this is fun') | |
| => "tothohisos isos fofunon" | |
| */ | |
| function translate(str) { | |
| var arr = str.split(''), | |
| out = ""; |
| //Simply make a temporary directory as a SVN sandbox | |
| mkdir temp; cd temp; | |
| //Checkout the latest Jefferson SVN | |
| svn co <svn-url> . | |
| //Wipe the current directory to a clean slate | |
| svn delete * | |
| //Manually copy all the files to the current SVN directory |
| /** | |
| Credit: Kyle Simpson | |
| https://github.com/getify/You-Dont-Know-JS/blob/master/async%20&%20performance/ch3.md#never-calling-the-callback | |
| */ | |
| // A utility for timing out a Promise | |
| function timeoutPromise(delay) { | |
| return new Promise( function(resolve,reject) { | |
| setTimeout( function() { | |
| reject( "Timeout!" ); |
| export function selectById(selectId, optionLabel) { | |
| return function() { | |
| const option = findWithAssert(`#${selectId} option:contains('${optionLabel}')`); | |
| fillIn(`#${selectId}`, option.attr('value')); | |
| return find(selectId).focusout(); | |
| }; | |
| } |