I hereby claim:
- I am tonywok on github.
- I am tonywok (https://keybase.io/tonywok) on keybase.
- I have a public key ASBcoIdY2d_xFoFbXJyD0jt9pJCvZj3e2lIltd14lQcLKQo
To claim this, I am signing this object:
name,card_type,rarity,image_url,initial_life,rules_box,type_line,mana_cost,element,earth_threshold,fire_threshold,water_threshold,wind_threshold,power,artist,set_identifier,flavor_text | |
Unland Eel,minion,ordinary,"https://static.wixstatic.com/media/965b5c_e7cafce2a0b74891a23c78cadf248c38~mv2.png/v1/fill/w_846,h_1182,al_c,usm_0.66_1.00_0.01,enc_auto/965b5c_e7cafce2a0b74891a23c78cadf248c38~mv2.png",,"**Submerge**, **Waterbound** | |
This Eel gains +2 power when attacking as it surfaces.",An Ordinary Beast of the deadly depths,2,water,,,1,,2,Francesca Baerald,1, | |
Unravel,magic,ordinary,"https://static.wixstatic.com/media/965b5c_e9547880aa9e4807b5453683d002fe67~mv2.png/v1/fill/w_846,h_1182,al_c,usm_0.66_1.00_0.01,enc_auto/965b5c_e9547880aa9e4807b5453683d002fe67~mv2.png",,Destroy target Relic or Undead minion.,Ordinary Magic of rot and rebirth,1,water,,,1,,,Severine Pineaux,1,"For life to rise, the dead must crumble." | |
Tide Naiads,minion,exceptional,"https://static.wixstatic.com/media/965b5c_796dab1d1f9b4eedb938817ee887d |
gem "db" | |
gem "db-postgres" | |
gem "thread-local" | |
require "db" | |
require "db/postgres" | |
require "active_record/connection_adapters/postgresql_adapter" | |
module ActiveRecord | |
# NOTE: This is the active record connection entry point. | |
# This method is called internally based on the adapter specified in database.yml |
# https://raganwald.com/2016/01/19/command-pattern.html | |
class State | |
attr_reader :history, :future | |
attr_accessor :text | |
def initialize(text) | |
@history = [] | |
@future = [] | |
@text = text |
I hereby claim:
To claim this, I am signing this object:
require "tsort" | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'pry' | |
gem 'pry-byebug' | |
end | |
require "forwardable" | |
class Operator | |
# TODO: probably raise if stuff isn't implemented | |
# TODO: probable register implementations | |
end | |
class Operand | |
# TODO: probably raise if stuff isn't implemented | |
# TODO: probable register implementations |
module Acronym | |
def abbreviate(string) do | |
string | |
|> String.codepoints | |
|> Enum.with_index | |
|> Enum.reduce("", fn({letter, idx}, acronym) -> | |
cond do | |
String.upcase(letter) == letter and String.downcase(letter) != letter -> | |
acronym <> letter | |
String.at(string, idx-1) == " " -> |
Note, at the time of writing this, I use a mac. Adjust to your preference.
If you're reading this and haven't done these things, and your laptop is still in your possession. Stop everything and do them now.
Applications are built for users. We give them distinguishing properties, connect them to other entities, respond to their actions, and make various decisions based on any combination of those things.
In rails, it's almost guaranteed that sitting inside of app/models/
is a class called User
. I'm sure you're intimately familiar with this class. In fact, I suspect that if you were to hack together a heat-map representing your code editor, user.rb
would probably be molten.
Taking this into consideration, how would you describe the responsibility of your User
model? I've noticed a few trends while working in rails:
Neo.UI.Mixin.Maybe = | |
maybeAnchored: (bool, url, dom...) -> | |
if bool | |
React.DOM.a(href: url, dom) | |
else | |
dom | |
maybeDisplayed: (bool, dom...) -> | |
if bool then dom else null |