Skip to content

Instantly share code, notes, and snippets.

View skorfmann's full-sized avatar

Sebastian Korfmann skorfmann

View GitHub Profile
/*Selects all contracts, which aren't billed yet*/
SET @start_date = '2010-06-01', @end_date = '2010-06-30';
SET @month = MONTH(CURDATE()), @year = YEAR(CURDATE());
SELECT c.id, c.start_date, c.end_date, IF(tmp.id IS NULL, 'Billable', 'Not Billable')
FROM contracts c
LEFT JOIN (
SELECT r.id, r.contract_id
FROM receivables r LEFT JOIN billing_cycles b ON r.billing_cycle_id = b.id
WHERE b.month = @month AND b.year = @year
#--
#
# Utility for creating Google Maps Encoded GPolylines
#
# License: You may distribute this code under the same terms as Ruby itself
#
# Author: Joel Rosenberg
#
# ( Drawing from the official example pages as well as Mark McClure's work )
#
rake
rdoc
mysql
haml
warden
formtastic
validation_reflection
devise -v=1.0.8
inherited_resources -v=1.0.6
rails -v=2.3.8
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
[["1007", "FRA", "Paris"],
["599", "ITA", "Rome"],
["556", "DEU", "Berlin"],
["493", "CHN", "Beijing"],
["476", "GBR", "London"],
["468", "CZE", "Prague"],
["464", "CHN", "Shanghai"],
["376", "TUR", "Istanbul"],
["311", "USA", "Houston"],
["301", "ESP", "Barcelona"],
#geocoding
http://where.yahooapis.com/geocode?location=#{lat}+#{lng}&select=long&gflags=R&flags=JG&locale=de_DE&appid=yriO3VLV34FFnugEQiyGOPxdYv34qVysSj18QREiX5OCucPPM4fv9Kxk1H3yp2SJ
#place
http://where.yahooapis.com/v1/place/#{woeid}?select=long&format=json&lang=de-DE&appid=yriO3VLV34FFnugEQiyGOPxdYv34qVysSj18QREiX5OCucPPM4fv9Kxk1H3yp2SJ
#ancestors of place
http://where.yahooapis.com/v1/place/#{woeid}/ancestors?select=long&format=json&lang=de-DE&appid=yriO3VLV34FFnugEQiyGOPxdYv34qVysSj18QREiX5OCucPPM4fv9Kxk1H3yp2SJ
begin
require 'tokyocabinet'
rescue LoadError
puts "You need the tokyocabinet gem"
exit
end
require 'md5'
require 'net/http'
#curl -e http://www.spiegel.de 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Apfelkernöl'
{
"responseData": {
"results": [
{
"GsearchResultClass": "GwebSearch",
"unescapedUrl": "http://www.mymovies.it/dizionario/recensione.asp?id\u003d17044",
"url": "http://www.mymovies.it/dizionario/recensione.asp%3Fid%3D17044",
"visibleUrl": "www.mymovies.it",
require 'rubygems'
require 'popen4' #http://popen4.rubyforge.org/
IO.popen("wall", "w") do |io|
io.write "hello from ruby"
end
@skorfmann
skorfmann / aws.rb
Created October 25, 2010 22:20
files going in lib/patches/*
module AWS
module S3
class Authentication
class CanonicalString
def initialize(request, options = {})
super()
@request = request
@headers = {}
@options = options
# "For non-authenticated or anonymous requests. A NotImplemented error result code will be returned if