Skip to content

Instantly share code, notes, and snippets.

View kubicek's full-sized avatar

Jiří Kubíček kubicek

View GitHub Profile
@kubicek
kubicek / gitio
Created January 22, 2012 19:47 — forked from defunkt/gitio
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@kubicek
kubicek / crowbar_admin.seed
Created January 22, 2012 19:40
Crowbar admin seed file
#### Contents of the preconfiguration file (for &releasename;)
### Localization
# Locale sets language and country.
d-i debian-installer/locale string en_US.utf8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
#d-i console-setup/modelcode string pc105
d-i console-setup/layoutcode string us
module ApplicationHelper
def number_to_currency(number, options = {})
options[:unit]=t(:czk)
options[:format]="%n %u"
super(number, options)
end
end
@kubicek
kubicek / gist:935066
Created April 21, 2011 17:36
Podpora Bundleru v Capistrano
after "deploy:update_code", "bundler:bundle_new_release"
namespace :bundler do
task :create_symlink, :roles => :app do
set :bundle_dir, File.join(release_path, 'vendor/bundle')
shared_dir = File.join(shared_path, 'bundle')
run "if [ -d #{bundle_dir} ]; then rm -rf #{bundle_dir}; fi" # in the event it already exists..?
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{bundle_dir}")
end
@kubicek
kubicek / .gitignore
Created November 28, 2010 01:54 — forked from karmi/.gitignore
.DS_Store
*.log
tmp/
class CreateAccounts < ActiveRecord::Migration
def self.up
create_table(:accounts) do |t|
t.string :name
t.string :surname
t.string :email
t.string :crypted_password
t.string :salt
t.string :role
t.timestamps
We couldn’t find that file to show.
pkg_add -r gmake erlang-lite libtool icu spidermonkey curl
cd /usr/ports/databases
fetch "http://www.freebsd.org/cgi/query-pr.cgi?prp=148803-1-txt&n=/patch.txt"
patch -p0 < patch.txt
rm patch.txt
cd /usr/ports/databases/couchdb
make install
function(doc, req) {
if(doc) {
return { \"headers\" : {\"Content-Type\" : \"application/xml\"}, \"body\" : doc.content }
} else {
return {\"code\": 404, \"body\": \"Not-found\"}
}
}
get '/companies/:ic' do
@db = CouchRest.database!("http://127.0.0.1:5984/obchodni_rejstrik")
doc = @db.get(params[:ic])
xml = Nokogiri::XML(doc['content'])
xslt = Nokogiri::XSLT(File.read('obchodni_rejstrik.xslt'))
xslt.transform(xml).to_s
end