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
var Random = { | |
/** | |
* Numbers between ~( -2 to 2 ) | |
* http://stackoverflow.com/questions/75677/converting-a-uniform-distribution-to-a-normal-distribution | |
* http://c-faq.com/lib/gaussian.html | |
*/ | |
gaussian: function() { | |
var x1, x2, r; |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
actions: { | |
error(error, transition){ | |
transition.send('setFlashMessage', 'ANOTHER ERRRR'); | |
} | |
} | |
}); |
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
import DS from 'ember-data'; | |
import Adapter from "ember-data/adapters/rest"; | |
const { errorsHashToArray } = DS; | |
export default Adapter.extend({ | |
handleResponse(status, headers, payload) { | |
if (this.isInvalid(...arguments)) { | |
payload.errors = errorsHashToArray(payload.errors); |
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
/** | |
* iOS 6 style switch checkboxes | |
* by Lea Verou http://lea.verou.me | |
*/ | |
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */ | |
position: absolute; | |
opacity: 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
/*global module:false, require:false*/ | |
var path = require('path'), | |
lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var folderMount = function folderMount(connect, point) { | |
return connect.static(path.resolve(point)); | |
}; | |
module.exports = function(grunt) { |
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
// install the 'request' package first with 'npm install request' | |
var request = require('request'); | |
// replace with your Keen IO project token | |
var projectToken = "501999234-FAKE-PROJECT-ID"; | |
// create a sample JSON event for an event collection | |
var eventCollection = "meals"; | |
var sampleEvent = { | |
username: "ralph", |
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
#!/usr/bin/env node | |
// | |
// BeautifulFaces.js | |
// https://gist.github.com/joelongstreet/5052198 | |
// | |
// Dependencies: | |
// imagesnap (npm install -g imagesnap) | |
// Description: | |
// Save this script as a post-commit hook to snap a photo of yourself and | |
// save it with your commit message |