Skip to content

Instantly share code, notes, and snippets.

View tjhanley's full-sized avatar
🏒

Thomas Hanley tjhanley

🏒
View GitHub Profile
@tjhanley
tjhanley / referrer.rb
Created September 2, 2021 16:43
url slug
class Referrer < ActiveRecord::Base
URL_SLUG_REGEX = /^[a-z0-9-]+$/i
attr_accessible :token, :campaign, :campaign_id, :user_id, :lead_id
belongs_to :campaign
belongs_to :user
belongs_to :lead
has_many :referral_click_throughs
@tjhanley
tjhanley / setup.md
Last active October 17, 2021 18:38
My Dev Setup

Engineering Home

Developer Setup

Brew

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Shell optional

@tjhanley
tjhanley / README.md
Created March 13, 2016 23:43
Angular Readme

My First Angular

Section 1

Best Practices

  • MV* separation
  • DRY
  • Don't hack

Don't write bad

{
"DueDate": "2013-02-15",
"Balance": 1990.19,
"DocNumber": "SAMP001",
"Status": "Payable",
"Line": [
{
"Description": "Sample Expense",
"Amount": 500,
"DetailType": "ExpenseDetail",
@tjhanley
tjhanley / 0_reuse_code.js
Created March 11, 2016 17:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tjhanley
tjhanley / shuffle-people.coffee
Created January 26, 2015 17:47
Shuffle Users
# Description:
# Generates a random list of users in the room
#
# Commands:
# hubot djs - gathers a list of users and shuffles them
#
# Author:
# tjhanley
module.exports = (robot) ->
robot.respond /djs/i, (msg) ->
@tjhanley
tjhanley / fdn.js
Created November 19, 2014 22:16
Is this okay to call in this order?
//= require foundation
// Contains register_media call
//= require shared_inits
$(function(){ $(document).foundation(); });
@tjhanley
tjhanley / adaptive_image.js
Last active August 29, 2015 14:09
Emerson Trait for lazy loading the correct images based on media query. Follows the same image list pattern as Foundation's Interchange
/**
* Combines some functionality of Foundation.interchange & custom Lazy Loading
*
* dependencies:
* Foundation
* jquery.viewport
*
* references:
* http://foundation.zurb.com/docs/components/interchange.html
* http://foundation.zurb.com/docs/javascript-utilities.html#media-queries
@tjhanley
tjhanley / README.md
Last active August 29, 2015 14:04
New Engineer Setup

What is this?

The goal of this is to have a script so new hires or new machines to get up and running real quick like.

How do I use it?

  • Install XCode from Mac App Store
  • Install Commandline Tools from Xcode> Open Developer Tool> More Developer Tools
@tjhanley
tjhanley / checkout.html
Last active August 29, 2015 14:02
Interchange no longer working. Foundation actually dies compeletly.
<img data-interchange="[//bevel-assets.s3.amazonaws.com/checkout/order-products.png,(default)], [//bevel-assets.s3.amazonaws.com/checkout/order-products@2x.png, (retina)]" src="" width="100%">