Skip to content

Instantly share code, notes, and snippets.

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'
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
runes=( ᚠ ᚢ ᚦ ᚨ ᚱ ᚲ ᚷ ᚹ ᚺᚻ ᚾ ᛁ ᛃ ᛇ ᛈ ᛉ ᛊᛋ ᛏ ᛒ ᛖ ᛗ ᛚ ᛜᛝ ᛟ ᛞ)
cast=()
while [[ ${#cast} -le 2 ]];do
let "idx = $RANDOM % ${#runes} + 1"
cast+=(${runes[$idx]})
done
prompt="$FG[154]${cast}%{$reset_color%} "
@gotascii
gotascii / gear_list.md
Last active August 29, 2015 14:07
Bikepacking gear list
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)
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", [])
[
{
"type": "exception",
"time": "2011-09-12T21:33:12Z"
},
{
"type": "exception",
"time": "2011-09-12T21:35:12Z"
}
]
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
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
let mapleader = ","
call pathogen#infect("~/.vim/langs")
call pathogen#infect()
""
"" File types
""
" Some file types should wrap their text