brew cask install virtualbox
brew cask install vagrant
brew cask install vagrant-manager
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-librarian-chef-nochef
cd MY_RAILS_PROJECT
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
Fixing Capistrano 3 deployments after a repository change | |
https://coderwall.com/p/4k1lja/fixing-capistrano-3-deployments-after-a-repository-change | |
vim DEPLOY-FOLDER/repo/config | |
``` | |
[core] | |
repositoryformatversion = 0 | |
filemode = true |
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
<svg> | |
<defs> | |
<!-- pattern1 - no aspect ratio control --> | |
<pattern id="pattern1" height="100%" width="100%" | |
patternContentUnits="objectBoundingBox"> | |
<image height="1" width="1" preserveAspectRatio="none" xlink:href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Gl%C3%BChwendel_brennt_durch.jpg/399px-Gl%C3%BChwendel_brennt_durch.jpg" /> | |
</pattern> | |
<!-- pattern2 - aspect ratio control on the image only --> | |
<pattern id="pattern2" height="100%" width="100%" |
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
class Recipe { | |
var name: String? | |
init(name:String?) { | |
self.name = name | |
} | |
} | |
for index in 1...15 { | |
var recipe = Recipe(name: "Test Recipe \(index)") |
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
(<<-MSG.squish) | |
text | |
MSG |
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
def set_locale_variables locale | |
I18n.locale = @request.session[:locale] = @request.cookies[:locale] = locale.to_s | |
end | |
def acceptable?(locale) | |
I18n.available_locales.map(&:to_s).include?(locale.to_s) | |
end | |
def set_locale(route_request = nil) | |
@request = try(:request) || route_request |
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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", | |
"default_line_ending": "system", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 18, | |
"ignored_packages": | |
[ | |
"Better CoffeeScript", | |
"Ruby Slim", | |
"Vintage" |
included do
# STATES: :draft | :published | :deleted
state_machine :state, initial: TheCommentsBase.config.default_state do
# events
event :to_draft do
transition all - :draft => :draft
end
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
var React = require('react/addons'); | |
var ReactIgnore = { | |
displayName: 'ReactIgnore', | |
shouldComponentUpdate (){ | |
return false; | |
}, | |
render (){ | |
return React.Children.only(this.props.children); | |
} |
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
# Сколько бы событий не произошло | |
# Обработчик будет выполнен только 1 раз | |
# после завершения событий через N ms | |
@debounce = (func, wait, immediate) -> | |
timeout = undefined | |
result = undefined | |
-> | |
context = this | |
args = arguments |