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
select friends.id from friends | |
left join line_items on (friends.id = line_items.friend_id and line_items.deleted_at is null) | |
where | |
friends.status != 'Deleted' | |
# MORE | |
select friends.id from friends | |
left join line_items on (friends.id = line_items.friend_id) | |
where | |
friends.status != 'Deleted' |
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
FROM python:2.7.12 | |
MAINTAINER Justin Marney <[email protected]> | |
RUN mkdir -p /opt/mungo_utils | |
WORKDIR /opt/mungo_utils | |
COPY . ./ | |
RUN pip install -r requirements.txt |
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
runes=( ᚠ ᚢ ᚦ ᚨ ᚱ ᚲ ᚷ ᚹ ᚺᚻ ᚾ ᛁ ᛃ ᛇ ᛈ ᛉ ᛊᛋ ᛏ ᛒ ᛖ ᛗ ᛚ ᛜᛝ ᛟ ᛞ) | |
cast=() | |
while [[ ${#cast} -le 2 ]];do | |
let "idx = $RANDOM % ${#runes} + 1" | |
cast+=(${runes[$idx]}) | |
done | |
prompt="$FG[154]${cast}%{$reset_color%} " |
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 load_spec(name) | |
spec_path = Dir.glob("#{Gem.dir}/specifications/#{name}-*.gemspec").last | |
Gem::Specification.load(spec_path) unless spec_path.nil? | |
end | |
def load_outter_gem_19(name) | |
spec = load_spec(name) | |
unless spec.nil? | |
spec.dependencies.each do |dep| | |
dep_spec = load_spec(dep.name) |
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 self.convert_response_to_thread_ids(response) | |
result = {} | |
result[:threaded_extended] = {} | |
if response == nil | |
result[:messages] = [] | |
result[:have_older_msgs] = false | |
else | |
threads = [] | |
messages = response[:json].fetch("messages", []) |
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
[ | |
{ | |
"type": "exception", | |
"time": "2011-09-12T21:33:12Z" | |
}, | |
{ | |
"type": "exception", | |
"time": "2011-09-12T21:35:12Z" | |
} | |
] |
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 cats(user_id, network_id) | |
email = "bob#{user_id}_#{network_id}@weird.com" | |
n = Network.find_or_create_by_email(email) | |
mu = MetaUser.find_or_create_by_email(email) | |
User.create do |u| | |
u.id = user_id | |
u.network = n | |
u.meta_user = mu | |
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
irb(main):009:0> GC.enable_stats | |
=> false | |
irb(main):013:0> GC.clear_stats | |
=> nil | |
irb(main):014:0> n.ar_users.select("id").find_in_batches(:batch_size => 1000) {|u| u } | |
=> nil | |
irb(main):015:0> GC.allocated_size | |
=> 902823508 | |
irb(main):016:0> ObjectSpace.allocated_objects | |
=> 104920800 |
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
let mapleader = "," | |
call pathogen#infect("~/.vim/langs") | |
call pathogen#infect() | |
"" | |
"" File types | |
"" | |
" Some file types should wrap their text |
NewerOlder