This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def number_to_currency(number, options = {}) | |
options[:unit]=t(:czk) | |
options[:format]="%n %u" | |
super(number, options) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
*.log | |
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(doc, req) { | |
if(doc) { | |
return { \"headers\" : {\"Content-Type\" : \"application/xml\"}, \"body\" : doc.content } | |
} else { | |
return {\"code\": 404, \"body\": \"Not-found\"} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |