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
class User < ActiveRecord::Base | |
# gradual engagement is needed, to allow admin creation of users | |
# users should create authorization data only when they need to | |
# access some system feature that requires authentication | |
# So ... our gradual engagement scheme for authlogic: | |
# 1. admin creates user, setting only name and phone number (required) | |
# admin may set email address (optional) | |
# 2. user is sent email invitation with link to activate their account | |
# admin can re-send email at user's request | |
# 3. user sets login and password/password_confirmation using activation form |
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
2012-03-29T10:25:10+00:00 app[app.1]: #bangalore-ruby <keyword> tweet - Returns a link to a tweet about <keyword> | |
2012-03-29T10:25:10+00:00 app[app.1]: <travis me> sferik/rails_admin - Returns the build status of https://github.com/sferik/rails_admin | |
2012-03-29T10:25:10+00:00 app[app.1]: <user> is a badass guitarist - assign a role to a user | |
2012-03-29T10:25:10+00:00 app[app.1]: <user> is not a badass guitarist - remove a role from a user | |
2012-03-29T10:25:10+00:00 app[app.1]: Find the build status of an open-source project on Travis | |
2012-03-29T10:25:10+00:00 app[app.1]: animate me <query> - The same thing as `image me`, except adds a few | |
2012-03-29T10:25:10+00:00 app[app.1]: convert me <expression> to <units> - Convert expression to given units. | |
2012-03-29T10:25:10+00:00 app[app.1]: help <query> - Displays all help commands that match <query>. | |
2012-03-29T10:25:1 | |
0+00:00 app[app.1]: help - Displays all of the help commands that bangalorehubot knows about. |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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/ruby | |
# encoding: utf-8 | |
# | |
# Updated 2017-10-25: | |
# - Defaults to large size (512) | |
# - If ImageMagick is installed: | |
# - rounds the corners (copped from @bradjasper, https://github.com/bradjasper/Download-iTunes-Icon/blob/master/itunesicon.rb) | |
# - replace original with rounded version, converting to png if necessary | |
# | |
# Retrieve an iOS app icon at the highest available resolution |