Skip to content

Instantly share code, notes, and snippets.

@begin29
begin29 / usefull_functions.js
Created November 11, 2016 18:19
JS usefull functions
// check if string contains word
"some_word".includes(word)
@begin29
begin29 / free_wifi_channels.sh
Created November 10, 2016 08:12
check free wifi channels
sudo iwlist wlan0 scan | grep \(Channel
@begin29
begin29 / private_vs_protected.rb
Created November 9, 2016 13:17
Private vs protected in ruby
class A
attr_reader :age
def initialize(age)
@age = age
end
protected :age
# private :age
# throw eror for other.age if age method is private
@begin29
begin29 / with_concern.rb
Last active November 8, 2016 12:51
From http://www.fakingfantastic.com/2010/09/20/concerning-yourself-with-active-support-concern/ Put instance methods inside module and include it to class
module TagLib
extend ActiveSupport::Concern
module ClassMethods
def find_by_tags()
# ...
end
end
module InstanceMethods
@begin29
begin29 / action_wraper.rb
Created November 8, 2016 12:10
Wrap any action in rails
include AbstractController::Callbacks
around_filter :wrap_it_in_error_catcher
def wrap_it_in_error_catcher
begin
yield
rescue => e
raise SomeExceptionClass.new
end
@begin29
begin29 / ruby-articles.rb
Last active July 8, 2017 02:53
ruby, rails useful articles
# factory patern in ruby
http://rubyblog.com.ua/2016/04/factory-method-pattern-in-ruby
#ruby recursion
https://www.leighhalliday.com/recursion-in-ruby
# ruby on rails optimisation tips
https://infinum.co/the-capsized-eight/articles/top-8-tools-for-ruby-on-rails-code-optimization-and-cleanup
# write faster ruby app
@begin29
begin29 / development-tools.rb
Last active July 10, 2016 09:41
development tools usefull documentation
# tips and trics in chrome tools
https://developer.chrome.com/devtools/docs/authoring-development-workflow
http://mo.github.io/2015/10/19/chrome-devtools.html
# aditional console command for chrome dev tool
http://blog.teamtreehouse.com/mastering-developer-tools-console
# web development tools
https://tproger.ru/digest/web-services/
@begin29
begin29 / css.rb
Last active July 10, 2016 08:51
css articles and tips
# css frameworks not only bootstrap
https://www.sitepoint.com/5-most-popular-frontend-frameworks-compared/
# css generators for generate buttons efects
https://habrahabr.ru/post/149863/
@begin29
begin29 / ruby-books.rb
Last active February 11, 2020 18:41
ruby, rails books
# === ruby books
# confident ruby
https://www.dropbox.com/sh/t4xu4t3hitqvqjy/AAAncKJ2s_9R-74WHv8zdVdYa?dl=0
# fareless refactoring
https://www.dropbox.com/sh/pobxg0jpz7ndho1/AACS84n6AAFnx1ppl4M2MNjLa?dl=0
# Sandy Metz Practical ruby design
https://www.dropbox.com/s/p8oejgchshk16ki/Sandi%20Metz%20-%20Practical%20Object-Oriented%20Design%20in%20Ruby.epub?dl=0
# Rails as she is spoke 2012
https://www.dropbox.com/s/jqvlcj15jv11hh3/Docfoc.com-Rails%20as%20She%20is%20Spoke.pdf?dl=0
# lean-publishing-growing-rails-applications-in-practice-2014
@begin29
begin29 / development.rb
Last active July 10, 2016 08:56
General development process
# release stages
http://www.chromium.org/developers/tech-talk-videos/release-process
# complex of algorithms explanation
https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/