Skip to content

Instantly share code, notes, and snippets.

@wycleffsean
wycleffsean / Arel and ActiveRecord.md
Created February 17, 2016 15:30
Arel and ActiveRecord

Join

users = User.arel_table
comments = Comment.arel_table

#select users with comments
User.join(
  users.joins(comments).on(
 users[:id].eq(comments[:user_id])
@wycleffsean
wycleffsean / example.coffee
Created July 17, 2015 05:21
Coffeescript Mixins
Mixin = require './mixin.coffee'
Module = require './module.coffee'
class Logger extends Mixin
yo = (msg) -> console.log msg
class_log: yo
@log: yo
class MyLogger extends Module
@extends Logger
@wycleffsean
wycleffsean / .bashrc
Last active August 29, 2015 14:07
dot files and tools
if [ -r $HOME/.rbenvrc ];
then
source $HOME/.rbenvrc
fi
if [ -r $HOME/.app_vars ];
then
source $HOME/.app_vars
fi
@wycleffsean
wycleffsean / SassMeister-input-HTML.html
Created March 24, 2014 05:26
Generated by SassMeister.com.
<header>
<span class="logo">Gizmosan</span>
<nav class="site-nav">
<a href="#">TVs</a>
<a href="#">Tablets</a>
<a href="#">PCs</a>
<form>
<input type="search" results=5 placeholder="search..." />
<button>Search</button>
</form>