Skip to content
import time
import webbrowser
total_breaks = 8
break_count = 0
while (break_count < total_breaks):
break_count = break_count + 1
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
application: Ember.inject.controller(),
queryParams: ['definedInController'],
appName:'Ember Twiddle',
definedInController: 'default'
View bin-squash_migrations
#!/usr/bin/env bash
git ls-files db/migrate/*.rb | sort | tail -1 | \
ruby -e "[/\d+/]; init_schema=%(db/migrate/#{schema_version}_init_schema.rb);
%x(git rm -f db/migrate/*.rb;
mkdir db/migrate;
git mv db/schema.rb #{init_schema};
rake db:migrate;
git add db/schema.rb; git commit -m 'Squashed migrations')"
View setup-pow.bash
#!/usr/bin/env bash
install() {
brew cask list lunchy >/dev/null || brew cask install lunchy
cd # In case user uses gemsets, ensure we're installing powder outside of a project
View is_fibonacci.rb
def is_fibonacci?(num)
n = (Math.log(num*2.23606797749979 + 0.5) * 2.0780869213681945).floor
num == (1.6180339887**n * 0.4472135954999579).round
View gen.rb
head = "#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
char *s = "

I'd like to narrow the Serializer interface rather than broaden it. Every method we add has the potential to interfere with an attribute on the model.

Also, with respect to this change, couldn't you just use the key option?

class FooSerializer < AM::Serializer attribute :name, key: title end FooSerializer._attributes_keys

View gist:67754b65ce30c37fad6a

OO solutions for imperative problems

[september, 22nd 2013]

On september 17th, 2013, Aaron Cruz wrote in the Objects on Rails mailing list:

I have a very imperative problem. Something needs to be done, then something else, then something else, constantly changing state from one step to the next.

Video Import example

Something went wrong with that request. Please try again.