Skip to content

Instantly share code, notes, and snippets.

@jrmehle
jrmehle / Railsconf MPLS Bike Ride
Last active Apr 27, 2019
Details of a possible planned bike ride for those attending RailsConf 2019 in Minneapolis
View Railsconf MPLS Bike Ride
Tweet: Any @railsconf attendees interested in a bike ride sometime next week? I'd love to show some folks around the trails along the river. We can keep the pace light. Willing to help figure out equipment rentals for out of town folks.
https://twitter.com/jrmehle/status/1121453494618198017
Date/Time: TBD, leaning towards Tuesday evening after day closing keynote (6:30ish?)
Distance: 10-15 miles
Routes:
Hyatt Regency to Minnehaha Falls (possible stop at Stone Arch) - 15 miles: https://goo.gl/maps/whujrFfT2AwBePWp9
Hyatt Regency to Lake Harriet (tour chain of lakes) - 10 miles: https://goo.gl/maps/fLzLHtXSPob2jftp9
View Gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.3'
gem 'pg', '0.18.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails', '~> 4.0.3'
View keybase.md

Keybase proof

I hereby claim:

  • I am jrmehle on github.
  • I am jrmehle (https://keybase.io/jrmehle) on keybase.
  • I have a public key ASDNms8zpJrit7vrAPMkc5aheCdGi0_nOgoL0-hih_IhPQo

To claim this, I am signing this object:

@jrmehle
jrmehle / db_backup.sh
Last active Sep 20, 2017 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
View db_backup.sh
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
fi
View coffee-select2
$('select#user_school_id').select2
minimumInputLength: 3
placeholder: 'Search for Your School'
View Sublime Config
{
"color_scheme": "Packages/User/idleFingers.tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
@jrmehle
jrmehle / gist:32458dc124db3407d5a8
Created Oct 29, 2014
Rubinius install fails in Yosemite
View gist:32458dc124db3407d5a8
ruby-install --rubies-dir ~/.rvm/rubies rbx 2.2.10
>>> Installing rbx 2.2.10 into /Users/jared/.rvm/rubies/rbx-2.2.10 ...
>>> Installing dependencies for rbx 2.2.10 ...
Warning: openssl-1.0.1j already installed
Warning: readline-6.3.8 already installed
Warning: libyaml-0.1.6 already installed
Warning: gdbm-1.11 already installed
>>> Downloading http://releases.rubini.us/rubinius-2.2.10.tar.bz2 into /Users/jared/src ...
>>> Verifying rubinius-2.2.10.tar.bz2 ...
>>> Extracting rubinius-2.2.10.tar.bz2 to /Users/jared/src/rubinius-2.2.10 ...
@jrmehle
jrmehle / bike_scraper.rb
Last active Aug 29, 2015
A script to quickly see if any bikes I'm interested in are in stock on my favorite site to buy bikes from.
View bike_scraper.rb
require 'nokogiri'
require 'open-uri'
require 'colorize'
class BikeScraper
BIKES_DIRECT_URL = 'http://www.bikesdirect.com/products/cross_bikes.htm'
TARGET_BIKE_SIZE_REGEX = /56cm/
TARGET_BIKE_NAME = 'Fantom'
def execute
View undefined method `ml_number_like=' for #<MetaSearch::Searches::NorthStar_Property:0x106258828>
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:138:in `method_missing'
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:116:in `send'
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:116:in `assign_attributes'
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:115:in `each_pair'
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:115:in `assign_attributes'
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:90:in `build'
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/searches/active_record.rb:32:in `search'
app/controllers/north_star/properties_controller.rb:22:in `search'
actionpack (3.0.3) lib/action_controller/metal/implicit_rend
View paperclip.rb
module Paperclip
module Dimension
def get_size_of(name, thumbnail=nil)
return '0x0' unless get_path_of(name, thumbnail)
Geometry.from_file(get_path_of(name, thumbnail)).to_s
end
# calculates width using processor
def get_width_of(name, thumbnail=nil)
return 0 unless get_path_of(name, thumbnail)