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) { | |
if (doc.content) { | |
var content = doc.content.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug 336551 | |
var data = new XML(content); | |
var dtt = new Namespace("http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.2"); | |
emit(doc._id, { | |
name: data..dtt::Obchodni_firma.text(), | |
ic: data..dtt::ICO.text(), | |
konkurz: data..dtt::Konkurz.dtt::Kod.text() | |
}); |
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) { | |
if (doc.content) { | |
var html = new XML(doc.content); | |
emit(doc._id, {title: doc.content}); | |
} | |
emit("nic", "nikde") | |
} |
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
#!/bin/bash | |
for ico in `cat ico.txt`;do | |
echo "FETCHING $ico" | |
`curl "http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_or.cgi?ico=$ico&ver=1.0.2"` >> data.xml | |
curl -X PUT --data-binary @data.xml http://localhost:5984/obchodni_rejstrik/_design/updater/_update/save_xml/$ico | |
done |
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
# Delete/Move Rails default files | |
log 'moving', 'Rails default files' | |
run "mv README doc/README_FOR_RAILS" | |
run "rm public/index.html" | |
# Copy database.yml | |
log "copying", "database.yml" | |
run "cp config/database.yml config/database.example.yml" | |
# Create App config |
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
d-i debian-installer/locale string en_US | |
d-i console-keymaps-at/keymap select 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
require 'rubygems' | |
require 'eventmachine' | |
require 'dnsruby' | |
module RedirectServer | |
def receive_data data | |
send_data <<EOF | |
HTTP/1.1 301 Moved Permanently | |
Location: http://www.daukce.cz/ | |
Content-Type: text/html |
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
Pokud /^jsem na (.+)$/ do |page_name| | |
Given "I am on #{page_name}" | |
end | |
Když /^jdu na (.+)$/ do |page_name| | |
When "I go to #{page_name}" | |
end | |
Když /^zmáčknu "([^\"]*)"$/ do |button| | |
When "I press \"#{button}\"" |
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
# Usage: | |
# rails project_name -m http://gist.github.com/127877.txt |
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
Požadavek: Znovunastavení hesla | |
Pro přihlášení v případě zapomenutého hesla | |
Uživatel | |
By měl mít možnost si heslo znovu nastavit | |
Scénář: Uživatel není zaregistrován | |
Pokud neexistuje uživatel s emailovou adresou "email@person.com" | |
Když požádám o zaslání odkazu pro znovunastavení hesla na "email@person.com" | |
Pak bych měl vidět "Neznámý e-mail." |
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 Performer | |
attr_accessor :object, :method_to_call, :parameters_for_method | |
def initialize(object, method_to_call, *parameters_for_method) | |
@object, @method_to_call, @parameters_for_method = object, method_to_call, parameters_for_method | |
end | |
def perform | |
object.send(method_to_call, *parameters_for_method) |