Skip to content

Instantly share code, notes, and snippets.

View leemour's full-sized avatar

Viacheslav Ptsarev leemour

View GitHub Profile
@leemour
leemour / Padrino generate.sh
Last active December 19, 2015 07:18
Padrino project generation example
padrino g project APP -d activerecord -t cucumber -e haml -c sass -s jquery -m mocha --migration_format=timestamp
@leemour
leemour / Ruby.sublime-build
Last active December 19, 2015 15:29 — forked from pmarreck/Ruby.sublime-build
Sublime use rvm
# Get Sublime to use your rvm ruby... Change your Packages/Ruby/Ruby.sublime-build to this,
# or drop it in Packages/User:
{
"env":{
"PATH":"/home/leemour/.rvm/bin:${PATH}"
},
"cmd": [
"/home/leemour/.rvm/bin/rvm-auto-ruby", "$file"
],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
@leemour
leemour / _footer.html.haml
Last active December 19, 2015 16:39
Rails 4 HTML5 Haml layout
@leemour
leemour / roubles.rb
Created July 17, 2013 06:02
Roubles format currency
def show_rubles( sum )
first, last = sum.to_f.round(2).to_s.split('.')
result = (first.reverse.gsub(/(\d{1,3})/, '\1;psbn&').reverse) + ' руб. '
result = result + last + ' коп.' if last != '0'
result.strip.html_safe
end
@leemour
leemour / Preferences.sublime-settings
Created August 12, 2013 11:10
Sublime Text 3 settings
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Railscasts.tmTheme",
"file_exclude_patterns":
[
".DS_Store",
".tags*",
"*.pyc",
"*.pyo",
@leemour
leemour / structure.html
Created August 21, 2013 09:50 — forked from anonymous/structure.html
Responsive Sass
<h2>A thumbnail grid with <a href="https://github.com/Team-Sass/Singularity">Singularity</a> and <a href="https://github.com/lolmaus/breakpoint-slicer">Breakpoint Slicer</a></h2>
<p>Play with the Page pane width to see the responsive magic!</p>
<div class=grid-item>
<div class=thumbnail>
<div class=thumbnail-content>
Thumbnail
</div>
</div>
</div>
class BatchItemProcessor
attr_accessor :processed_items
def initialize
@processed_items = []
end
def process_items(list)
list = list.select(&@condition) if @condition
items = parse list
@leemour
leemour / RubyRVM.sublime-build
Created September 6, 2013 15:41 — forked from pmarreck/Ruby.sublime-build
Build Ruby with RVM in Sublime Text 3
# Get Sublime to use your rvm ruby... Change your ~/Library/Application Support/Sublime Text 2/Packages/Ruby/Ruby.sublime-build to this, replacing YOURUSERNAME:
{
"cmd": [
"bundle", "exec", "/Users/YOURUSERNAME/.rvm/bin/rvm-auto-ruby", "$file"
],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
// borrowed from https://github.com/samflores
Prism.languages.ruby = {
'comment': /#[^\r\n]*(\r?\n|$)/g,
'string': /("|')(\\?.)*?\1/g,
'regex': {
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,
lookbehind: true
},
'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g,
'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment: