Skip to content

Instantly share code, notes, and snippets.

@peponi
peponi / gist:2895602
Created June 8, 2012 13:26
update database over heroku console
heroku console User.last.update_attribute :credits,"42" --app YOUR_APP_NAME
@peponi
peponi / count_win_or_mac_requests.rb
Created June 8, 2012 13:22
count how many clients come over OS X or Windows
# https://github.com/visionmedia/user-agent
agent = Agent.new request.user_agent
User.os_name = agent.os
User.count(:conditions => "os_name = 'OS X' OR os_name = 'OS X 10.4' OR os_name = 'OS X 10.5' OR os_name = 'OS X 10.6' OR os_name = 'OS X 10.7'")
User.count(:conditions => "os_name = 'Windows 7' OR os_name = 'Windows Vista' OR os_name = 'Windows 2000' OR os_name = 'Windows XP' OR os_name = 'Windows 2003'")