Skip to content

Instantly share code, notes, and snippets.

@awoodworth
awoodworth / setting.rb
Created November 20, 2016 02:09
Rails - Reload Classes
class Setting < ActiveRecord::Base
validates :name, :value, presence: true
validates :name, uniqueness: true
after_update :reload_classes
#..
private
@awoodworth
awoodworth / seeds.rb
Created March 11, 2015 17:27
CSV to Seed-Fu
# NOTE: you will want to change the three attributes at the top
require 'csv'
require 'seed-fu'
# change these
@csv_file = 'export.csv'
@output_file = 'class.rb'
@class_name = 'Class'
@seeds = CSV.read("#{@csv_file}", { headers: true } )
@awoodworth
awoodworth / keybase.md
Last active August 29, 2015 14:15
Keybase

Keybase proof

I hereby claim:

  • I am awoodworth on github.
  • I am awoodworth (https://keybase.io/awoodworth) on keybase.
  • I have a public key whose fingerprint is 633B 8BD7 4013 2020 0AAA AB79 87DD 8E0D 1FDE 9E41

To claim this, I am signing this object:

@awoodworth
awoodworth / callbacks.sh
Last active August 29, 2015 14:15
Hackery
#!/bin/bash
# searching for callbacks
cd /etc
grep -ErHn "10.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" * >> ~/callbacks.txt