Skip to content

Instantly share code, notes, and snippets.

@seanirby
seanirby / gist:5617662
Created May 21, 2013 05:31
Technical Blog Post Outline: Has And Belongs to Many Associations in Rails
A. Intro
1.Go over associations and specifically explain the motivation for using a has and belongs to many association
B. Body
1. Create two models
2. Create the associations in each respective model file
@seanirby
seanirby / gist:5727048
Created June 7, 2013 04:20
Need a to this user data in its own hash in params
<%#= NEED TO Namespace potential user params %>
<%= form_tag send_invite_path, :method => "post" do %>
<%= label_tag :email, "Email" %>
<%= text_field_tag :email %>
<%= label_tag :first_name, "First Name" %>
<%= text_field_tag :first_name %>
<%= label_tag :last_name, "Last Name" %>
<%= text_field_tag :last_name %>
@seanirby
seanirby / SassMeister-input-HTML.html
Created November 10, 2013 22:07
Variables and Nesting
<h1>DRY Your Code With Nesting and Variables</h1>
<article id="firstPanel" class="panel">
<h3>Panel 1</h3>
<div class="block"></div>
</article><!--
--><article id="secondPanel" class="panel">
<h3>Panel 2</h3>
<div class="block"></div>
</article><!--
<h1>Write Less With 'mixins'</h1>
<div id="container">
<div></div>
<div></div>
<div></div>
</div>
<h1>Implement Inheritance Using '@extend'</h1>
<span class="message success">Success</span>
<span class="message error">Error</span>
<span class="message warning">Warning</span>
<h1>Use Math Operators Anywhere!</h1>
<div class="row">
<div class="column grid_12"><p>12</p></div>
</div>
<div class="row">
<div class="column grid_6"><p>6</p></div>
<div class="column grid_6"><p>6</p></div>
</div>
@seanirby
seanirby / SassMeister-input-HTML.html
Created November 11, 2013 04:10
Generated by SassMeister.com.
<div>
<p><span>S</span>yntactically</p>
<p><span>A</span>wesome</p>
<p><span>S</span>tyle</p>
<p><span>S</span>heets</p>
</div>
;;;; Hydra for quickly switching among the 8 most recent buffers
;;;; by using the home row keys.
;; This is the command that toggles the hydra.
;; Change the keybinding if you like
(global-set-key (kbd "C-c j") 'hydra-bswitch/body)
(defvar bswitch-map (list 1 "a"
2 "s"
3 "d"
class BlinkManager {
constructor(displayObj, changeFunc1, changeFunc2, changeFuncEnd, rate, duration){
this.displayObj = displayObj;
this.changeFuncEnd = changeFuncEnd;
this.duration = duration;
this.rate = rate;
this.blinkCount = 0;
this.totalCount = 0;
this.last = changeFunc2;
this.next = changeFunc1;
@seanirby
seanirby / directional_target.yaml
Last active June 11, 2020 12:09
Mission Pinball Framework Config for a Joystick Target
#config_version=5
# This mode detects collisions on our joystick target. It emits these
# 5 events for each of the different collisions that can occur:
# joystick_left_hit
# joystick_diagonal_left_hit
# joystick_up_hit
# joystick_diagonal_right_hit
# joystick_right_hit