This file contains hidden or 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
| call pathogen#infect() | |
| set nocompatible | |
| syntax on | |
| set nu | |
| set ruler | |
| " настраиваем табуляцию | |
| set shiftwidth=2 | |
| set tabstop=2 |
This file contains hidden or 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 'cgi' | |
| namespace :b000 do | |
| desc 'b000.ru images parser' | |
| task :parser => :environment do | |
| max_image_id = ENV['MAX_IMAGE_ID'] || 2344 | |
| # чтобы по стопицот раз не пытаться сохранить одни и те же фотографии | |
| min_image_id = ENV['MIN_IMAGE_ID'] || Image.scoped.select('max(external_id) AS m')[0].m |
This file contains hidden or 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
| # as we’re going to use Unicorn as the application server | |
| # we’re not going to use common sockets | |
| # but Unix sockets for faster communication | |
| upstream shop { | |
| # fail_timeout=0 means we always retry an upstream even if it failed | |
| # to return a good HTTP response (in case the Unicorn master nukes a | |
| # single worker for timing out). | |
| # for UNIX domain socket setups: | |
| server unix:/tmp/shop.socket fail_timeout=0; |
This file contains hidden or 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 | |
| ### BEGIN INIT INFO | |
| # Provides: unicorn | |
| # Required-Start: $local_fs $remote_fs $network $syslog | |
| # Required-Stop: $local_fs $remote_fs $network $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts the unicorn web server | |
| # Description: starts unicorn |
This file contains hidden or 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 'mongo' | |
| require 'mongo_mapper' | |
| MongoMapper.database = 'words' | |
| class Word | |
| include MongoMapper::Document |
This file contains hidden or 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
| # coding: utf-8 | |
| require 'pp' | |
| require 'rubygems' | |
| require 'hpricot' | |
| require 'iconv' | |
| require 'net/http' | |
| xml = File.read('9001274.xml') | |
This file contains hidden or 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/php | |
| <?php | |
| /** | |
| * @url http://vredniy.ru | |
| * @author Dmitry Zudochkin <[email protected]> | |
| **/ | |
| $obj = json_decode(file_get_contents('http://fucking-great-advice.ru/api/random')); |
NewerOlder