This file contains hidden or 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
## Rails development best practices | |
# An #RMM alternative, open and collaborative set of development practices we can adhere to. | |
* Distributed Version Control over relying on the File System | |
* Business Logic in the Models over being spread throughout the MVC layers | |
* RESTful Architecture over overloaded controllers | |
* KISS - Short methods with descriptive names | |
* Tests/Specs covering each layer of MVC and the whole stack | |
* Document the setup procedure (freeze dependancies where possible) | |
* Allow developers to listen to favorite music while coding, Put them in zero interruption zone |
This file contains hidden or 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 'singleton' | |
module ActiveSupport | |
# to correct it yourself (explained below). | |
module Inflector | |
extend self | |
class Inflections |
This file contains hidden or 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
class User < ActiveRecord::Base | |
has_profile_items [:first_name] | |
#has_pfeed_bucket | |
def buy(x) | |
puts "buying" | |
end |
This file contains hidden or 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
# Monitor HTTP requests being made from your machine with a one-liner.. | |
# Replace "en1" below with your network interface's name (usually en0 or en1) | |
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" | |
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile: | |
# (again replace "en1" with correct network interface name) | |
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"" | |
# All the above tested only on OS X. |
This file contains hidden or 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
# urlmonitor - print out the URLs requested system wide on the main network interface | |
# Accept a network interface name as an optional argument | |
iface = ARGV.first | |
# No interface specified? Try to guess which one is king.. | |
unless iface | |
`ifconfig -l`.split.each do |iface| | |
next if iface =~ /^lo/ | |
break if `ifconfig #{iface}` =~ /inet (0|1|2)/ |
This file contains hidden or 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
# SUPER DARING APP TEMPLATE 1.0 | |
# By Peter Cooper | |
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
This file contains hidden or 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 ruby | |
# Patched mongrel for Garbage Collection | |
require 'mongrel' | |
unless Mongrel.const_defined?("UnixDispatchServer") | |
puts "Patched mongrel required!" | |
exit | |
end | |
Mongrel::UnixDispatchServer.preload_application do |
This file contains hidden or 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 | |
# Usage: | |
# cd /path/to/rails_app | |
# wget "http://is.gd/sIkX" | |
# bash parolkar_stat.sh | |
# cat stat.txt | |
# | |
echo "Data for parolkar =================" > stat.txt | |
cat /proc/cpuinfo >> stat.txt |
This file contains hidden or 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
In response to all the responses to: | |
http://twitter.com/rtomayko/status/1155906157 | |
You should never do this in a source file included with your library, | |
app, or tests: | |
require 'rubygems' | |
The system I use to manage my $LOAD_PATH is not your library/app/tests |
OlderNewer