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 KubicekMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
#tohle se vola pred aplikaci | |
env["REQUEST_URI"]="/welcome" | |
#zavolame aplikaci | |
status, headers, response = @app.call(env) |
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 | |
# | |
# Based on drbfs example by Kent Sibilev | |
require 'lib/fusefs' | |
# We're basically just passing all requests on to the local filesystem. | |
class UfsDirectory | |
def initialize(dir) | |
@dir = dir |
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) |
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
# 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
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
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
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
# 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
#!/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 |