Skip to content

Instantly share code, notes, and snippets.

View gerhard's full-sized avatar

Gerhard Lazu gerhard

View GitHub Profile
******************************************
Ruby Developer Required @ JobsGoPublic.com
******************************************
==============================
The Company - JobsGoPublic.com
==============================
# 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
# 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
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
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
# Run me with:
#
# $ watchr less.watchr
# --------------------------------------------------
# Helpers
# --------------------------------------------------
def lessc(file)
print "compiling #{file.inspect}... "
system "lessc #{file}"
# 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
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')
#! /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 goes in ~/.freeagent
ENV['FA_COMPANY'] = 'mycompany'
ENV['FA_USERNAME'] = 'myloginemail'
ENV['FA_PASSWORD'] = 'mypassword'