controller: page-specific
model: if the business object as a canonical representation
helpers, components: generic configurable elements
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(); | |
}; | |
} |
# Set up a listener | |
nc -l 1234 | |
# spawn ember-cli that proxies to the listener | |
ember s --proxy http://localhost:1234 | |
# curl "as ajax" | |
curl -H 'X-Requested-With: XMLHttpRequest' -H 'Accept: application/json' localhost:4200/api/foo | |
#result in the listener tab: |
// The following two function convert string Maps to and from objects: | |
// http://www.2ality.com/2015/08/es6-map-json.html | |
function strMapToObj(strMap) { | |
let obj = Object.create(null); | |
for (let [k,v] of strMap) { | |
// We don’t escape the key '__proto__' | |
// which can cause problems on older engines | |
obj[k] = v; | |
} |
export default Ember.Component.extend({ | |
_setup: Ember.on('init', function() { | |
//do stuff in this method | |
}), | |
_teardown: Ember.on('willDestroyElement', function() { | |
//if you need a spot to tear down ... | |
}) | |
}); |
/** | |
README.md | |
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'); |