Skip to content

Instantly share code, notes, and snippets.

View schrader's full-sized avatar

Julian J. Schrader schrader

View GitHub Profile
@trevorturk
trevorturk / no_www.rb
Created November 3, 2009 05:03
no-www rack middleware
class NoWWW
STARTS_WITH_WWW = /^www\./i
def initialize(app)
@app = app
end
def call(env)
if env['HTTP_HOST'] =~ STARTS_WITH_WWW
@stammy
stammy / application_helper.rb
Created April 26, 2011 08:42
rails 3 pretty page titles. no more instance vars all up in your controllers
module ApplicationHelper
# pretty page titles
# yield_for(:title, 'default text goes here') in layout
# content_for(:title, 'some text') in view
def yield_for(content_sym, default)
output = content_for(content_sym)
output = default if output.blank?
output
end
end
@schrader
schrader / gist:2037831
Created March 14, 2012 16:52
Hide/Show apps from Lion's dock (shell command)
Hide Application from Dock:
defaults write /Applications/Application.app/Contents/Info LSUIElement 1
Show Application in Dock:
defaults write /Applications/Application.app/Contents/Info LSUIElement 0
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@janniswiese
janniswiese / Create Task in Things for Ashes
Created May 8, 2013 04:58
Adds a "Create Task in Things" action to Ashes on iOS
ashes://addOpenURL?title=Create%20Task%20in%20Things&url=things%3Aadd%3Ftitle%3D%5B%5B%5Btitle%5D%5D%5D%26notes%3D%5B%5B%5Bpost%5D%5D%5D
@JMichaelTX
JMichaelTX / Copy EN Note Link (Classic) AS.applescript
Last active June 10, 2020 05:10
[EN] Classic - Evernote Mac - Put Classic Note Link on Clipboard as Rich Text using Note Title -- AppleScript
@bxt
bxt / xml-to-csv.rb
Created April 26, 2017 22:53
Convert XML to CSV file using Ruby (nokogiri)
require 'csv'
require 'nokogiri'
filename = "timeentries"
doc = File.open("#{filename}.xml") { |f| Nokogiri::XML(f) }
entries = doc.css('time-entry')
CSV.open("#{filename}.csv", "wb") do |csv|