Person/Place/Thing | Shit-storm level (tm) |
---|---|
Obama / Healthcare | ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo] |
ERB and HAML templates | ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo] |
Matt Newton Metaprogramming | ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo] |
T-Mobile | ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo] |
John | ![1][poo] |
Ruby Hash Rockets | ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo] |
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
# 1. Paste this in console | |
def show_mongo_db_operations | |
if Moped.logger == Rails.logger | |
Moped.logger = Logger.new($stdout) | |
true | |
else | |
Moped.logger = Rails.logger | |
false | |
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
model = YourModel | |
current_index_keys = model.collection.indexes.entries.map{|x| x['key'].stringify_keys unless x['key'] == {"_id"=>1}}.compact | |
defined_index_keys = model.index_options.keys.map{|x| x.stringify_keys} | |
current_index_keys.each do |k| | |
model.collection.indexes.drop(k) unless defined_index_keys.include?(k) | |
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
Resque::Failure.each do |f| | |
if Resque::Failure.all(f)["failed_at"].to_datetime.year < 2015 | |
Resque::Failure.remove(f) | |
end | |
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
["1a", "3", "1b", "2a", "3a", "2b", "1"].sort | |
"1a".next | |
"1az".next | |
"1aaz".next |
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
## | |
## tinyproxy.conf -- tinyproxy daemon configuration file | |
## | |
## This example tinyproxy.conf file contains example settings | |
## with explanations in comments. For decriptions of all | |
## parameters, see the tinproxy.conf(5) manual page. | |
## | |
# | |
# User/Group: This allows you to set the user and group that will be |
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
function find_docker_container() { | |
docker ps -q --filter ancestor=$1 | |
} |