This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'railroad/models_diagram' | |
require 'railroad/options_struct' | |
options = OptionsStruct.new | |
options.parse = ['--verbose'] | |
mod = ModelsDiagram.new options | |
mod.generate | |
mod.graph.nodes.each do |node| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'railroad/models_diagram' | |
require 'railroad/options_struct' | |
options = OptionsStruct.new | |
options.parse = ['--verbose'] | |
mod = ModelsDiagram.new options | |
mod.generate | |
mod.graph.nodes.each do |node| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# This script produces a complete tree structure for the directory | |
# in which it is running. | |
# | |
# FROM | |
# http://www.sun.com/bigadmin/scripts/submittedScripts/lstree.sh.txt | |
# | |
# Modifications by Adam Bachman | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# For example, you're deep in prototyping mode, and want to keep your test | |
# and development environments in sync. Don't keep typing: | |
# rake RAILS_ENV=test db:migrate && rake RAILS_ENV=development db:migrate | |
# instead: | |
# rakes -dt db:migrate | |
# | |
# don't repeat yourself. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# drop in your ~/.bashrc file. guaranteed to "works on my machine". | |
# | |
# Go straight to the root of the current rails project. | |
# example: | |
# ~/workspace/proj/app/models $ rr | |
# going to /home/user/workspace/proj | |
# ~/workspace/proj $ | |
# | |
# /etc/init.d/ $ rr | |
# /etc/init.d/ $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demonstration of a handful of the metaprogramming features of Ruby. | |
# | |
# This code uses the same class/module configuration as Rails' standard | |
# acts_as plugins. I was looking for a way to extend the behavior of an | |
# ActiveRecord model in practice, and this came out of that exploration. | |
# | |
# Each "method" of extending the target class is tested and evaluated | |
# for functionality and a report is printed. | |
# | |
# Each method is tested as a class method and an instance method, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Kill Uservoice | |
// @namespace adam_bachman | |
// @description Kill Uservoice Tab | |
// @include * | |
// ==/UserScript== | |
(function () { | |
var uservoice_tab = document.getElementById("uservoice-feedback-tab"); | |
if (uservoice_tab) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Imitate <%= submit_tag 'Perform an Action', :disable_with => "" %> button | |
using Rails' remote_function options. | |
Requires prototype.js, but could easily be written with any other js framework. | |
Not production tested. | |
--> | |
<span id='my_link'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy svn:ignore files between directories. Handy when checking out and working | |
# on branches. This script is specific to my needs, but could be easily | |
# generalized. | |
# - Adam Bachman, Sept 2009 | |
usage() { | |
printf "Copies svn:ignore'd rails configurations from one project to another.\n\n" >&2 | |
printf "Usage: %s /from/dir /to/dir \n\n" $(basename $0) >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 localhost | |
127.0.1.1 adam-desktop | |
### @NOPROCRAST ### | |
127.0.0.1 news.ycombinator.com | |
127.0.0.1 youtube.com www.youtube.com | |
127.0.0.1 techmeme.com www.techmeme.com | |
127.0.0.1 techcrunch.com www.techcrunch.com | |
127.0.0.1 reddit.com www.reddit.com | |
127.0.0.1 hacker-newspaper.gilesb.com |
OlderNewer