Skip to content

Instantly share code, notes, and snippets.

@bxt
bxt / xml-to-csv.rb
Created Apr 26, 2017
Convert XML to CSV file using Ruby (nokogiri)
View xml-to-csv.rb
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|
@JMichaelTX
JMichaelTX / Copy EN Note Link (Classic) AS.applescript
Last active Jun 10, 2020
[EN] Classic - Evernote Mac - Put Classic Note Link on Clipboard as Rich Text using Note Title -- AppleScript
View Copy EN Note Link (Classic) AS.applescript
@janniswiese
janniswiese / Create Task in Things for Ashes
Created May 8, 2013
Adds a "Create Task in Things" action to Ashes on iOS
View Create Task in Things for Ashes
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
View README.md

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

@schrader
schrader / gist:2037831
Created Mar 14, 2012
Hide/Show apps from Lion's dock (shell command)
View gist:2037831
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
@stammy
stammy / application_helper.rb
Created Apr 26, 2011
rails 3 pretty page titles. no more instance vars all up in your controllers
View application_helper.rb
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
@trevorturk
trevorturk / no_www.rb
Created Nov 3, 2009
no-www rack middleware
View no_www.rb
class NoWWW
STARTS_WITH_WWW = /^www\./i
def initialize(app)
@app = app
end
def call(env)
if env['HTTP_HOST'] =~ STARTS_WITH_WWW