Skip to content

Instantly share code, notes, and snippets.

View savonarola's full-sized avatar
🏠
Working from home

Ilia Averianov savonarola

🏠
Working from home
View GitHub Profile
#foo
%span
Hello!
st = gets.chomp
w = st.dup
correct = true
l = st.length
i=0
while i<l
if w[i..i]=='z'
w[i..i]='T'
else
if (w[i..i] != 'a')and(w[i..i] !='b')
def roundcornr(css_class, resizable=true,&block)
haml_tag :table, :class => "#{css_class}_table" do
haml_tag :tr do
haml_tag :td, :class => "#{css_class}_tl"
haml_tag :td, :class => "#{css_class}_t"
haml_tag :td, :class => "#{css_class}_tr"
end
haml_tag :tr do
haml_tag :td, :class => "#{css_class}_l"
haml_tag :td, :class => "#{css_class}_content" do
def roundcornr_many(table_class, css_classes,&block)
haml_tag :table, :class => "#{table_class}_table" do
haml_tag :tr do
css_classes.map do |css_c|
rnd_class, contents_class, spacer_class = css_c
haml_tag :td, :class => "#{rnd_class}_tl"
haml_tag :td, :class => "#{rnd_class}_t"
haml_tag :td, :class => "#{rnd_class}_tr"
if spacer_class
haml_tag :td, :class => spacer_class
=roundcornr :red_area, false do
=image_tag '/images/plate_opaque.png'
=image_tag '/images/plate_opaque.png'
=roundcornr_many :red_area, [ [ :red_area, :red_area_content, :test_spacer ],[ :red_area, nil, :test_spacer ],[ :red_area ] ] do |i|
- case i
- when 0
=image_tag '/images/plate_opaque.png'
=image_tag '/images/plate_opaque.png'
=image_tag '/images/plate_opaque.png'
#!/usr/bin/perl -w
use strict;
use HTTP::Request::Common;
use LWP::UserAgent;
use CGI qw(header -no_debug);
my $leprastaffurl = 'http://leprastuff.ru/index.php/upl/img';
my $tinyurl = 'http://tinyurl.com/api-create.php';
my $req = POST $leprastaffurl,
Content_Type => 'form-data',
с запросом данных с сервера:
----------------------------
1. Нажатие по ссылке "skip the photo >>". (next) //Страница хона
2. Голосование за фото:
2.1. при нажатии на радио кнопку из HON (vote) //Страница хона
2.2. при нажатии на радио кнопку из фотоальбома (albvote) //Страница фотоальбома
3. Переход по ссылке из списка "All photos", или по ссылке на фото в статистике. (direct)
===============================================
return $self->rs("Questions")->search(
{ id => { 'NOT IN' => $user->games()->search_related('games_questions')->search_related('questions')->get_column('id')->as_query() } },
{ order_by => \'RANDOM()',
rows => 1
}
)->single();
13:58 savonarola@kub:~>telnet localhost 33333
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
POST /wiki/страница HTTP/1.1
Host: ru.wikipedia.org
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9b5) Gecko/2008050509 Firefox/3.0b5
Accept: text/html
Connection: close
Content-Length: 10
module Main where
import Control.Monad
data ExprTree = Var Char | Op ExprTree Char ExprTree
readExprS :: ReadS ExprTree
readExprS ('(':s) = do
(l, op:s1 ) <- readExprS s