Skip to content

Instantly share code, notes, and snippets.

@ewilliam
ewilliam / duel_of_the_bots.ink.json
Created June 26, 2019 07:20
Deafverse World 1 ink file
-> C0T
== C0T ==
# special: true
# video: C0T.mp4
- Welcome to our lab at the National Deaf Center. Here, we track a group of worlds in a parallel universe we call the “Deafverse.” Today you will be traveling through the first world. In this world you meet a friendly robot who needs your help to rescue another robot that has lost its way. You will encounter everyday situations and challenges. In each situation, you will be presented with several choices, each will take you down a path depending on the decisions you make. You can take a break anytime you like, and come back to continue playing Deafverse!
Remember, in the Deafverse, you are the one who chooses your future!
* Start Chapter One
-> C1S1P1
$font-family-sans-serif:
// Safari for OS X and iOS (San Francisco)
-apple-system,
// Chrome < 56 for OS X (San Francisco)
BlinkMacSystemFont,
// Windows
"Segoe UI",
// Android
"Roboto",
// Basic web fallback
@ewilliam
ewilliam / scheme.rb
Last active March 25, 2018 19:27
dependent destroy issue
class Scheme < ApplicationRecord
has_one :logo, as: :imageable, class_name: 'Image', dependent: :destroy
has_many :steps, class_name: 'Scheme::Step', dependent: :destroy
has_many :screens,
through: :steps, source: :steppable, source_type: 'Screen'
has_many :screen_groups,
through: :steps, source: :steppable, source_type: 'Screen::Group'
has_many :scheme_responses, class_name: 'Scheme::Response'
def assignments=(assignments)
assignments.each_with_index do |a, i|
instance_name = "@assignment_#{i}_view"
# set @assignment_view here if instance_variable_get returns nil
unless instance_variable_get(instance_name)
view = build_assignment_label([[50, 0], [325, 50]], 16, UIFontWeightThin, i)
instance_variable_set(instance_name, view)
end
@assignment_view = instance_variable_get(instance_name)
@assignment_view.text = a.summary
class BankAccountForm
include Virtus.model
include ActiveModel::Model
attribute :country, String
attribute :routing_number, String
attribute :account_number, String
attribute :first_name, String
attribute :last_name, String
attribute :dob, Hash[String => String]
@ewilliam
ewilliam / congress.js
Last active August 29, 2015 14:12
congress email sending. sendgrid not in yet
$(document).ready(function(){
$("a.send").click(function() {
$address = $("#addy").val();
$apiUrl = "https://congress.api.sunlightfoundation.com/legislators/locate?zip=" + $address
$.ajax({
url: 'https://congress.api.sunlightfoundation.com/legislators/locate?zip=92506', // can't use apiUrl variable?
@ewilliam
ewilliam / gist:8720404
Created January 30, 2014 21:37
MVC Presentation
Hi, I’m William Albright, engineer for Linguabee.
Let me start with thanking Shanley and Amelia and everybody else involved in the MVC project. I’ve been following Shanley for a while, I know she’s onto good things!
When she said she would be setting up a media organization focusing on tech, diversity, and culture; I was really excited. Why? Obviously its important but I don’t think everybody understands it on the same level.
Consider my experience interviewing for an intern position at VWGOA, before I considered to become an engineer, when I sat in a room with the HR boss and 2 interpreters. That experience would stay with me the rest of my life; during the interview, one of the interpreters couldn’t understand me at all. She kept misunderstanding what I said, and the other interpreter would correct her sometimes. The only thing I communicately clearly was disappointment through my face so HR boss would understand that I was having difficulty with the interpreter, as a way to mitigate the damage.
This is
@ewilliam
ewilliam / gist:5171037
Last active December 15, 2015 00:09
Initialize prob
class Herbivore < Player
before_save :set_values
def set_values
self.xp = 0
self.max_xp = 50
self.hp = 5
self.max_hp = 5
self.ap = 3
self.max_ap = 3