Skip to content

Instantly share code, notes, and snippets.

@ecarnevale
ecarnevale / .git-completion.bash
Created August 1, 2011 16:41
source ~/.git-completion.bash
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
[user]
name = Emanuel Carnevale
email = my_email_not_here_for_spammers
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
def create
soap_request = request.env['rack.input'].read
filename = "#{Time.now.iso8601(6)}_#{request.env['REMOTE_ADDR']}.txt"
File.open("#{Rails.root}/soap_requests/#{filename}", 'w') {|f| f.write(soap_request)}
Station.parse_xml(soap_request)
request.format = "soap"
render :layout => false
end
#!/usr/bin/env ruby
require 'mail'
# source = 'archives/2005-11.txt'
# month = 11
# year = 2005
#
# system "perl -ne 'if(/^From /){open F,\">eml/msg-#{year}-#{month}-\".++$m.\".eml\"}print F' #{source}"
@ecarnevale
ecarnevale / gist:999654
Created May 31, 2011 00:02 — forked from RobSpectre/gist:999620
Tagging an object on FluidINFO
fluidDB.put({
url: 'about/' + encodeURIComponent(sender.tab.url) + '/jeterfilter/contains-jeter',
payload: Math.round(((new Date()).getTime()-Date.UTC(1970,0,1))/1000),
async: false,
primitive: true,
username: fluidDBUsername,
password: fluidDBPassword,
success: function(json) {
console.log('URI tagged as containing Jeter.');
}
fsssss:fluidinfo_work emanuel$ time python match_itunes_musicbrainz.py ~/Music/iTunes/iTunes\ Music\ Library.xml
This will take a while. Try `tail -f match_itunes_musicbrainz.log`
Could not match 1635 tracks, 25.94% of your library.
2717 exact matches, 1952 inferred matches
Would you like to see the list of inferred matches?
Traceback (most recent call last):
File "match_itunes_musicbrainz.py", line 150, in <module>
main()
File "match_itunes_musicbrainz.py", line 79, in main
answer = prompt or raw_input("[Y/n] ")
@ecarnevale
ecarnevale / gist:999554
Created May 30, 2011 22:11
an Exception
INFO:root:Track: 会いたい人
INFO:root:Artist: 矢井田瞳 (Yaida Hitomi)
INFO:root:Album: i/flancy
DEBUG:<class 'musicbrainz2.webservice.WebService'>:GET http://musicbrainz.org/ws/1/track/?artist=%E7%9F%A2%E4%BA%95%E7%94%B0%E7%9E%B3%E3%80%80%28Yaida+Hitomi%29&type=xml&title=%E4%BC%9A%E3%81%84%E3%81%9F%E3%81%84%E4%BA%BA
DEBUG:<class 'musicbrainz2.webservice.WebService'>:GET http://musicbrainz.org/ws/1/track/?artist=%E7%9F%A2%E4%BA%95%E7%94%B0%E7%9E%B3%E3%80%80%28Yaida+Hitomi%29&type=xml&title=
DEBUG:<class 'musicbrainz2.wsxml.MbXmlParser'>:ExpatError: no element found: line 1, column 0
WARNING:root:MusicBrainz raised exception: no element found: line 1, column 0
WARNING:root:Could not find match!
;; I'm not saying this is good Clojure, but it was off the top of my head
;; It's a title bot for jschat.org
(import '(java.io BufferedReader InputStreamReader PrintWriter))
(import '(java.net Socket))
(import '(java.net HttpURLConnection URL))
(use '[clojure.contrib.json.read :only (read-json)])
(use '[clojure.contrib.json.write :only (json-str)])
;; Data structures
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
# encoding: utf-8
module I18n
module Backend
# A simple backend that reads translations from YAML files and stores them in
# an in-memory hash. Relies on the Base backend.
#
# The implementation is provided by a Implementation module allowing to easily
# extend Simple backend's behavior by including modules. E.g.:
#