This file contains hidden or 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
describe('Ember.SoundPlayerView', function() { | |
var player; | |
beforeEach(function() { | |
player = Ember.SoundPlayerView.create({ url: '/__spec__/fixtures/song.mp3' }); | |
waitForReady(); | |
}); | |
afterEach(function() { | |
player.get('sound').stop(); |
This file contains hidden or 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
App = Ember.Application.create(); | |
App.Store = DS.Store.extend({ | |
adapter: 'DS.FixtureAdapter' | |
}); | |
App.Router.map(function () { | |
this.resource('songs'); | |
this.resource('song', { path: '/song/:song_id' }); | |
}); |
This file contains hidden or 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
class CreateTempArrays < ActiveRecord::Migration | |
def change | |
create_table :temp_arrays do |t| | |
t.string :array | |
t.boolean :sorted | |
t.integer :parent_id, :integer | |
t.timestamps | |
end | |
end |
This file contains hidden or 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
# Learn Metaprogramming | |
yes. |
This file contains hidden or 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
module HStored | |
module ClassMethods | |
def field(key, options = {}) | |
key = key.to_s | |
scope "has_#{key}", lambda { |value| where("properties @> (? => ?)", key, value) } | |
define_method(key) do | |
return options[:default] if options[:default] && !(properties && properties[key]) | |
property = properties && properties[key] |
This file contains hidden or 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
# Dont work =( | |
class SpiralFlood: | |
def __init__(self): | |
self.tiles = [] | |
def spiralFlood(self, sx, sy, K, m): | |
x = y = 0 | |
dx = 0 | |
dy = -1 |
This file contains hidden or 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
{{#form_for user classes=”form-horizontal”}} | |
<legend>User Data:</legend> | |
{{input “name”}} | |
{{input “birthday” as=”date”}} | |
{{input “another_date” as=”string” mask=”##/##/####” component=”datepicker”}} | |
{{input “email”}} | |
{{input “gender” as=”select” collection=App.genders}} | |
{{input “categories” as=”checkboxes” collectionBinding=”App.categoriesController”}} | |
{{input “option” as=”radio_buttons” collectionBinding=”App.optionsController”}} |
This file contains hidden or 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
squares([ | |
[X11, X12, X13, X14, X15, X16, X17, X18, X19], | |
[X21, X22, X23, X24, X25, X26, X27, X28, X29], | |
[X31, X32, X33, X34, X35, X36, X37, X38, X39], | |
[X41, X42, X43, X44, X45, X46, X47, X48, X49], | |
[X51, X52, X53, X54, X55, X56, X57, X58, X59], | |
[X61, X62, X63, X64, X65, X66, X67, X68, X69], | |
[X71, X72, X73, X74, X75, X76, X77, X78, X79], | |
[X81, X82, X83, X84, X85, X86, X87, X88, X89], | |
[X91, X92, X93, X94, X95, X96, X97, X98, X99] |
This file contains hidden or 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
export HISTCONTROL=ignoredups | |
# check the window size after each command and, if necessary, |
NewerOlder