Skip to content

Instantly share code, notes, and snippets.

View wavebeem's full-sized avatar

Sage Fennel wavebeem

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
checkboxes: Ember.computed(function() {
return Array.from({length: 4}, (x, i) => Ember.Object.create({checked: i >= 2}));
}),
checkboxesAsJson: Ember.computed('checkboxes.@each.checked', function() {
return JSON.stringify(this.get('checkboxes'), null, 2);
})
# cd to directory of dotfiles based on this script.
$scriptDir = Split-Path $SCRIPT:MyInvocation.MyCommand.Path -Parent
$dir = Resolve-Path (Join-Path $scriptDir "..")
cd $dir
function install($path) {
$dir = Split-Path $Path
$filename = (ls $path).Name
if ($dir) {
$prefix = Resolve-Path (Join-Path $HOME ".$dir")
#!/usr/bin/env python
import sys
import time
def uchar(code):
return ('\\U%08x' % code).decode('unicode-escape')
start = 0x1F550
end = 0x1F55B
emoji = map(uchar, range(start, end + 1))
#!/usr/bin/env ruby
def spin
("\u{1F550}" .. "\u{1F55B}").cycle.each do |moji|
print moji, " "
sleep 0.1
print "\r"
end
end
module MyDecorators
def limit(max, name)
tries = 0
m = instance_method(name)
define_method(name) do |*args|
tries += 1
if tries <= max
m.bind(self).call(*args)
else
raise "LIMITER ENGAGED"
const P = require('parsimmon');
const Chalk = require('chalk');
function wants(x) {
process.stdout.write(Chalk.bold.red('( wants ' + Chalk.cyan(x) + ' ) '));
return x;
}
function got(x) {
console.log(Chalk.bold.green('( GOT ' + Chalk.cyan(x) + ' )'));
@wavebeem
wavebeem / fish_prompt.fish
Created April 30, 2016 05:01
Custom fish prompt of random emoji every time
function fish_prompt
set E
set E $E \U1F51C # soon
set E $E \U1F354 # hamburger
set E $E \U1F4A9 # poo
set E $E \U1F47A # tengu
set E $E \U1F349 # watermelon
set E $E \U1F300 # cyclone
set E $E \U1F37A # beer
set E $E \U1F382 # cake
var util = require("util");
var P = require("parsimmon");
// Throw away whitespace surrounding a string.
function operator(s) {
return P.optWhitespace
.then(P.string(s))
.skip(P.optWhitespace);
}
function fly(creature) {
return (
"The " + creature.species +
" flies using its " + creature.methodOfFlight
);
}
function hunt(creature, otherCreature) {
return (
"The " + creature.species +
export default [
"module1",
"module2"
].map(x => System.import(x)).then(([
module1,
module2
])) => {
return {
myApi: whatever
};