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 an example of importing https://github.com/component/color-picker | |
* into an Ember app. However, you can import any node module. | |
* | |
* Create an in-repo addon: | |
* | |
* $ ember g in-repo-addon rollup | |
* | |
* You should have a file `lib/rollup/index.js`. | |
* Replace the contents of that file with the stuff below. |
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
// @flow | |
/* :: | |
export type Hamster = { | |
age: number, | |
birthday: Date, | |
} | |
*/ |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := 1.0 | |
for i := 0;; i++ { |
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'; | |
import run from 'ember-runloop'; | |
/** | |
* Copied from https://github.com/cibernox/ember-power-select/blob/master/test-support/helpers/ember-power-select.js | |
*/ | |
function fireNativeMouseEvent(eventType, selectorOrDomElement, options = {}) { | |
let event = new window.Event(eventType, { bubbles: true, cancelable: true, view: window }); | |
Object.keys(options).forEach((key) => event[key] = options[key]); | |
let target; |
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
# Prerequisits | |
* ffmpeg (brew install ffmpeg) | |
* imagemagick (brew install imagemagick) | |
# Steps | |
1. Use quicktime to capture your video and save it | |
2. `ffmpeg -i source.mov -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif` |
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
#!/bin/sh | |
# | |
# This script imports node modules into your app without the use of | |
# ember-browserify. To use, | |
# | |
# $ ./wrap_node_module.js | |
# | |
# (For the sake of an example, I use Lodash below.) | |
# |
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
// seeing if github always returns a 409 conflict - seems like it does | |
// this is also a good way of teasing out github's error responses, which are undocumented (or i haven't browsed the docs carefully enough) | |
const co = require('co') | |
const request = require('superagent') | |
const sleep = require('co-sleep') | |
const btoa = require('btoa') | |
const token = process.env.TOKEN |
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
const co = require('co') | |
const request = require('superagent') | |
const atob = require('atob') | |
const btoa = require('btoa') | |
const sleep = require('co-sleep') | |
const token = process.env.TOKEN | |
if (!token) throw new Error('need token') |
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
function explicit(ctx, fn) { | |
return function() { | |
try { | |
const result = fn.apply(ctx, arguments) | |
return [null, result] | |
} catch (err) { | |
return [err, null] | |
} | |
} |
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', | |
people: [ | |
{ | |
name: 'jason' | |
}, | |
{ |