You may not like all rules presented here, but they work very well for me and have helped producing high quality code. Everyone is free to code however they want, write and follow their own style guides, but when you contribute to my code, please follow these rules:
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
localhost@~:$ itsu "eue? z nfr b levfkf? xnj xnj-nj ghjgecnbkb" | |
угу, я так и думала, что что-то пропустили |
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
## Output | |
1 фонарь | |
21 фонарь | |
11 фонарей | |
2 фонаря | |
20 фонарей | |
100 фонарей |
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/ruby | |
class BTree | |
class Node | |
def initialize( tree, offset, start_value ) | |
@tree = tree | |
@offset = offset | |
@values = [ start_value ] | |
@subtree_offsets = [ nil ] * ( @tree.elements_per_node + 1 ) |
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 'test/spec' | |
require 'mocha' | |
# Do not load redgreen when loaded from eshell | |
# | |
unless ENV[ "EMACS" ] == "t" | |
require 'redgreen' | |
end |
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
desc "Call this when creating new project" | |
task :bootstrap do | |
# Clean just edited rakefile ;) | |
sh( "rm *~" ) unless Dir[ "*~" ].empty? | |
# Directories.. | |
@prev = ENV[ "PREV" ] || "azsservice" | |
sh( "mkdir -p app/controllers" ) | |
sh( "mkdir -p app/views" ) | |
sh( "mkdir -p app/models" ) |
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 | |
module MkRam | |
class Path | |
def initialize | |
@path = File.expand_path( "~/ram" ) | |
end | |
def to_s | |
@path | |
end |
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
== config/queries.yml | |
output_encoding: cp1251 # utf-8, cp866 etc. | |
input_encoding: cp1251 | |
query_sources: | |
google: # name for query engine | |
base: "http://news.google.com/news/search?pz=1&cf=all&ned=ru_ru&hl=ru&q=%s" | |
stories: | |
css: "#search-stories .story" | |
title: |
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
+-wrapper-----------------------------------------------------------+ // wrapper element | |
: +--inputDiv---------------------------------------------------+ : | |
: : * input : : // textarea replace | |
: +-------------------------------------------------------------+ : | |
: +--scroller---------------------------------------------------+ : | |
: : +--code-------------------------------------------------+ : : | |
: : : * measure : : : | |
: : : +--mover------------------------------------------+ : : : | |
: : : : +--gutter-----------------------------------+ : : : : | |
: : : : : *gutterText : : : : : |
OlderNewer