Skip to content

Instantly share code, notes, and snippets.

View juliamae's full-sized avatar

Julia Valentine juliamae

View GitHub Profile
@juliamae
juliamae / RESQUE_REMOVE_DUPLICATES.md
Last active September 29, 2018 00:31 — forked from rafaelgaspar/RESQUE_REMOVE_DUPLICATES.md
Remove duplicate jobs from a Resque queue.

remove_duplicates.rb

Remove duplicate Resque jobs that have already been queued for processing.

Execute

To run this against a Rails installtion in production use the following command: bundle exec rails runner -e production /path/to/script/remove_duplicates.rb. See rails runner for more information.

Notes

@juliamae
juliamae / brady_mascot_fears.md
Last active December 29, 2016 16:59
Brady win% by mascot type

Brady Win % by Type of Mascot*

Mascot* Win %
horse 63.64%
mythical being 71.43%
industry 72.55%
other animal 72.73%
overall 76.56%
@juliamae
juliamae / brady_mascot_splits.rb
Created January 10, 2015 21:44
Tom Brady's career records split by mascot type
require 'csv'
require 'pp'
csv = <<-CSV
Cardinals,2,1,1,bird
Falcons,4,4,0,bird
Ravens,6,5,1,bird
Bills,26,23,3,human
Panthers,4,2,2,cat
Bears,4,4,0,"other animal"
#!/usr/bin/env ruby
#
# This hook can be found in https://github.com/juliamae/githooks
commit_msg_file = ARGV[0]
branch_name = `git branch | grep '*'`.gsub(/[* |\n]/,"")
if message = open(commit_msg_file).read
open(commit_msg_file, 'w') do |f|
f.puts message.gsub("Merge", ":part_alternation_mark:erge")
@juliamae
juliamae / streaming_template_renderer-segmentation-fault.txt
Created December 15, 2011 18:45
Segmentation fault at action_view/renderer/streaming_template_renderer.rb:88
Started GET "/" for 127.0.0.1 at 2011-12-15 13:42:31 -0500
(0.2ms) SHOW search_path
Processing by FeaturePointsController#index as HTML
Completed 200 OK in 96ms (Views: 95.9ms | ActiveRecord: 0.0ms)
/Users/julia/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_view/renderer/streaming_template_renderer.rb:88: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
-- control frame ----------
c:0024 p:---- s:0118 b:0118 l:000117 d:000117 CFUNC :resume
c:0023 p:0066 s:0115 b:0115 l:000640 d:001d88 BLOCK /Users/julia/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_view/renderer/streaming_template_renderer.rb:88
@juliamae
juliamae / 2011-12-09
Created December 10, 2011 00:06
Shareabouts benchmark for 2011-12-09
Summary
=======
locations.json with 22 points
-------
Total transferred: 439900 bytes
HTML transferred: 400200 bytes
Requests per second: 25.56 [#/sec] (mean)
Time per request: 39.124 [ms] (mean)
@juliamae
juliamae / gist:753311
Created December 23, 2010 18:01 — forked from luke0x/gist:115795
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
=======================================================================
EC2 Setup
---------
1 Launch New ec2 instance - ami-1634de7f
2 Create elastic IP [ELASTIC_IP] and associate it with instance
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP
@juliamae
juliamae / gist:661838
Created November 3, 2010 22:35 — forked from jcbozonier/gist:131289
markov chains in python
from __future__ import with_statement
import random
def create_chain(file_paths):
word_counter = {}
previous_word = ""
for path in file_paths:
with open(path) as file:
for line in file:
words = line.split(" ")
@juliamae
juliamae / food my cats like
Created February 3, 2010 03:24
cats' fav foods
fancy feast trout dinner - thom & casio
fancy feast ocean whitefish and tuna feast - classic - thom & casio
fancy feast salmon & ocean white fish - flaked - thom & casio
bff tuna & shrimp - casio
bff tuna & veggies - thom
fancy feast tuna & mackerel - flaked - thom
@juliamae
juliamae / brooklyn snow poem
Created January 29, 2009 17:35
brooklyn snow poem
The snow is falling in three directions at once against the sienna brick of the houses across
but the storm is mild, the light even, the erratic wind not harsh, and, tolling ten o'clock,
the usually undistinguished bells of the Sixth Street cathedral assume an authoritative dignity,
remarking with ponderous self-consciousness the holy singularities of this now uncommon day.
How much the pleasant sense, in our sheltering rooms, of warmth, enclosure: an idle, languid taking in,
with almost Georgian ease, voluptuous, reposeful, including titillations of the sin of well-being,
the gentle adolescent tempest, which still can't make up its mind quite, can't dig in and bite,
everything for show, flailing with a furious but futile animation wisps of white across the white.
~ C. K. Williams, "One Morning in Brooklyn"