Skip to content

Instantly share code, notes, and snippets.

View kubicek's full-sized avatar

Jiří Kubíček kubicek

View GitHub Profile
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=ljet4 -sOutputFile=- /home/kubicek/margin.ps - | /usr/local/libexec/tray_select.rb -L
import sys, os, optparse, re
def die(msg):
print >>sys.stderr, '%s: %s' % (sys.argv[0], msg)
sys.exit(1)
def getParser():
parser = optparse.OptionParser(
usage='%prog [OPTIONS] DIR',
description='Allow restricted git operations under DIR',
users:
kubicek:
repositories:
- "xnet/superstudent.git"
- "xnet/aukce.git"
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)
#!/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
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)
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."
# Usage:
# rails project_name -m http://gist.github.com/127877.txt
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}\""
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