Skip to content

Instantly share code, notes, and snippets.

Avatar

Pedro Fayolle pilaf

  • Beezwax Datatools Inc.
View GitHub Profile
@pilaf
pilaf / abandon_hope.rb
Created May 16, 2017
DSL brainstorming for Magic implementation in Ruby
View abandon_hope.rb
class AbandonHope < Magic::Card
# short for:
# name "Abandon Hope"
# cost "{X}{1}{B}"
head "Abandon Hope", "{X}{1}{B}"
# short for `type :sorcery`
sorcery
text "As an additional cost to cast :name, discard X cards",
@pilaf
pilaf / candy.rb
Last active Jan 27, 2017
Favorite candy
View candy.rb
#== Migrations
class CreateUsers < ActiveRecord::Migration[5.0]
def change
create_table :users do |t|
t.string :name
t.timestamps
end
end
end
@pilaf
pilaf / time.rb
Created Feb 10, 2016
Code golf - Time
View time.rb
gets
puts"%9s
%5s%8s
%s%14s
%s%16s
%s%14s
View slides.md

title: Beezwax.net remastering layout: true class: center, middle, inverse

#Beezwax.net remastering

Foobar

View ember-data.dependent-relations.js
/**
Ember Data: Dependent Relationships
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),
View ember-data.dependent-relations.js
/**
Ember Data: Dependent Relationships
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),
View embedded-records-mixin.js
var get = Ember.get;
var forEach = Ember.EnumerableUtils.forEach;
var camelize = Ember.String.camelize;
var pluralize = new Ember.Inflector();
App.EmbeddedRecordsMixin = Ember.Mixin.create({
/**
Serialize `belongsTo` relationship when it is configured as an embedded object.