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
****************************************** | |
Ruby Developer Required @ JobsGoPublic.com | |
****************************************** | |
============================== | |
The Company - JobsGoPublic.com | |
============================== | |
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
# zesty.rb | |
## Bit Zesty default rails stack | |
# Delete unnecessary files | |
run "rm README" | |
run "rm doc/README_FOR_APP" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run 'rm -f public/javascripts/*' #add your fav js lib here |
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
# all defaults | |
matthew@bumble:~$ cat /etc/apache2/mods-enabled/deflate.conf | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css | |
</IfModule> | |
matthew@bumble:~$ cat /etc/apache2/mods-enabled/deflate.load | |
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so | |
# gzip test @ http://www.gidnetwork.com/tools/gzip-test.php |
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
def fudge_time | |
User.record_timestamps = false | |
u = User.find_by_email(email) | |
u.updated_at = 11.minutes.ago | |
u.save | |
User.record_timestamps = true | |
end |
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
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 |
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
# Run me with: | |
# | |
# $ watchr less.watchr | |
# -------------------------------------------------- | |
# Helpers | |
# -------------------------------------------------- | |
def lessc(file) | |
print "compiling #{file.inspect}... " | |
system "lessc #{file}" |
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
# Taken from passenger_memory_stats script | |
# Returns the private dirty RSS for the given process, in KB. | |
def determine_private_dirty_rss(pid) | |
total = 0 | |
File.read("/proc/#{pid}/smaps").split("\n").each do |line| | |
line =~ /^(Private)_Dirty: +(\d+)/ | |
if $2 | |
total += $2.to_i | |
end |
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 'money' | |
require 'xe_exchange' | |
Money.default_bank = XE::Exchange.instance | |
ten_dollars = Money.new(1000, 'USD') | |
ten_dollars_in_pounds = ten_dollars.exchange_to('GBP') |
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/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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
# this goes in ~/.freeagent | |
ENV['FA_COMPANY'] = 'mycompany' | |
ENV['FA_USERNAME'] = 'myloginemail' | |
ENV['FA_PASSWORD'] = 'mypassword' |
OlderNewer