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 'active_support/core_ext' | |
require 'cgi' | |
require 'yaml' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'pp' | |
require 'curb' | |
require 'json' |
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
*.db | |
*.swp |
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
classHello< Goliath::API use Goliath::Rack::Params use Goliath::Rack::JSONP use Goliath::Rack::Validation::RequestMethod, %w(GET) use Goliath::Rack::Validation::RequiredParam, {:key => 'echo'}defresponse(env) [200, {}, {pong: params['echo’]}]endendMiddlewareNo rackup file | |
22. classBonjour< Goliath::APIdefresponse(env) [200, {}, "bonjour!"]endendclassRackRoutes< Goliath::API map '/version'do run Proc.new { |env| [200, {}, ["Version 0.1"]] }end get "/bonjour", Bonjournot_found('/') do# run Proc. new { ... }endendRoutingsimple, but powerful | |
23. classAsyncUpload< Goliath::APIdefon_headers(env, headers)env.logger.info'received headers: '+headersenddefon_body(env, data)env.logger.info'received data chunk: '+ dataenddefon_close(env)env.logger.info'closing connection'enddefresponse(env)# called when request processing is completeendendAsync Request Processingdon’t need to wait for the full request… | |
24. classStream< Goliath::APIdefresponse(env)pt=EM.add_periodic_timer(1) { env.stream_send("hello") }EM.add_timer(10) do |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>RunAtLoad</key> | |
<true/> | |
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
uri = 'http://kgbi-1.ru/svai' | |
type='Сваи квадратного сечения' | |
content = open(uri).read | |
content.encode('utf-8') | |
doc = Nokogiri::HTML(content) | |
rows = doc.css('table.table1 tr') | |
e=rows[0] | |
puts "#{e.css('td:nth(1) text()').text.strip.chomp} #{e.css('td:nth(2) text()').text.strip.chomp} #{e.css('td:nth(3) text()').text.strip.chomp} #{e.css('td:nth(4) text()').text.strip.chomp} #{e.css('td:nth(5) text()').text.strip.chomp}" |
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
[CDATA[прибл. | |
[менее | |
[до | |
[От | |
[- 50 … +70 | |
От \+(\d)0С до \+(\d\d)0С=+\1…+\2°C | |
\+(\d{1,3})0С\s?…\+(\d{1,3})0С=+\1…+\2°C | |
. при укладке слоем 10мм.=del | |
кгм2..- |
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 bash | |
set -o errtrace | |
set -o errexit | |
facter_version=$1 | |
puppet_version=$2 | |
target_volume=$3 |
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
# encoding: utf-8 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'pp' | |
require 'curb' | |
require File.dirname(__FILE__) + '/proxied_curl' | |
require 'iconv' | |
require 'anemone' | |
# require 'mongo' |
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
mongorestore --db aggreagator_development /Users/surkov/Downloads/dump/aggregator-staging/ |
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
# encoding: utf-8 | |
#Оцените качество магазина на Яндекс.Маркете. | |
module Scraper | |
include FileProcs | |
class Object | |
def send_chain(*args) | |
o=self | |
args.each do |arg| |