Skip to content

Instantly share code, notes, and snippets.

Joshua Miller joshuamiller

View GitHub Profile
View portland-recs.md

Food

Food Carts

  • SE 28th & Ankeny
    • Wolf & Bear's (Israeli)
    • Le Pantry (upscale but not expensive)
    • Captured Beer Bus (Oregon beer, cider, wine on tap)
  • SE 12th & Hawthorne (Cartopia)
    • Chicken & Guns (incredible Latin rotisserie chicken)
View flavor.rb
#!/usr/bin/ruby
# encoding: US-ASCII
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
#
# Requirements: json gem (`gem install json`)
#
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
View gist:8322930
julia> reports["Lat"]
1130-element DataArray{Float64,1}:
40.2717
40.2661
40.2925
40.2498
40.2765
40.2704
40.2644
40.2731
View rails4-rc1-routes.rb
# config/routes.rb
get '/sign_in' => 'user_sessions#new', :as => :sign_in
post '/sign_in' => 'user_sessions#create', :as => :sign_in
# Output
#=> Invalid route name, already in use: 'sign_in'
#=> You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
#=> http://guides.rubyonrails.org/routing.html#restricting-the-routes-created
View 0001-Ensure-runtime-exists-before-building-runtime-platfo.patch
From 6d442e38286fa6c3a3ca9e355ee532c87cee1a90 Mon Sep 17 00:00:00 2001
From: Joshua Miller <elefantstn@gmail.com>
Date: Tue, 31 May 2011 22:16:35 -0400
Subject: [PATCH] Ensure runtime/ exists before building runtime/platform.conf
---
rakelib/platform.rake | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/rakelib/platform.rake b/rakelib/platform.rake
View 0001-Add-and-casecmp-to-Symbol.patch
From 6255dd5f7263624e36295d21b0180fc88c599621 Mon Sep 17 00:00:00 2001
From: Joshua Miller <josh@joshinharrisburg.com>
Date: Thu, 19 May 2011 19:13:28 -0700
Subject: [PATCH] Add #<=> and #casecmp to Symbol
---
kernel/common/symbol.rb | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/kernel/common/symbol.rb b/kernel/common/symbol.rb
View order.rb
def total
line_items.map {|i| i.price.to_f * i.quantity.to_i }.sum *
(1.0 - quantity_discount)
end
def remaining_total
total - payments.map(&:amount).compact.sum
end
def quantity_discount
View map.php.html
function initialize() {
var map = new google.maps.Map(document.getElementById("map"), {
center: new google.maps.LatLng(81, -158.5),
zoom: 3,
disableDoubleClickZoom: true,
mapTypeControlOptions: {
mapTypeIds: ["nw"]
}
});
map.mapTypes.set('nw', nwMapType);
View Spreadsheet Skeleton.rb
class SpreadsheetConverter < Sinatra::Base
post '/convert' do
content_type "application/xls-or-whatever"
convert(params[:spreadsheet])
end
private
def convert(spreadsheet)
View init.el
(setq mac-option-key-is-meta nil)
(setq mac-command-key-is-meta t)
(setq mac-command-modifier 'meta)
(setq mac-option-modifier nil)
;; via http://www.viget.com/extend/emacs-24-rails-development-environment-from-scratch-to-productive-in-5-minu/
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
You can’t perform that action at this time.