- Install DNSMasq
$ brew install dnsmasq
- Install DNSCrypt-proxy
$ brew install dnscrypt-proxy
CarrierWave.configure do |config| | |
if Rails.env.development? || Rails.env.test? | |
config.storage = :file | |
else | |
config.storage = :fog | |
config.fog_credentials = { | |
:provider => 'OpenStack', | |
:openstack_auth_url => 'https://auth.selcdn.ru/v1.0', | |
:openstack_username => Rails.application.secrets.openstack_username, | |
:openstack_api_key => Rails.application.secrets.openstack_api_key |
# | |
# This file is the units database for use with GNU units, a units conversion | |
# program by Adrian Mariano adrianm@gnu.org | |
# | |
# March 2014 Version 2.10 | |
# | |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 | |
# 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 | |
# Free Software Foundation, Inc | |
# |
require 'rubygems' | |
require 'rmagick' | |
require 'color_namer' | |
img = Magick::ImageList.new('photo.jpg') | |
img.resize_to_fit!(500) # resize the image to have faster quantization | |
quantized = img.quantize(16) # quantize the photo to reduce number of colors | |
img.destroy! # prevent memory leaks |
@mixin background-image-retina($file, $type, $width, $height) { | |
background-image: url($file + '.' + $type); | |
@media (-webkit-min-device-pixel-ratio: 2) { | |
& { | |
background-image: url($file + '@2x.' + $type); | |
-webkit-background-size: $width $height; | |
} | |
} | |
} |
#!/usr/bin/ruby | |
require 'yaml' | |
class Database | |
attr_reader :config_file, :settings | |
def initialize | |
@config_file = File.expand_path(File.join(File.dirname(__FILE__), "../../config/database.yml")) |
# requires root permissions in /usr/bin/ | |
star = String.new | |
8.times { star += "*" } | |
Star = "\n#{star * 3}\n" | |
def newblock string | |
puts "\n#{Star}#{string}#{Star}\n" | |
end |
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP | |
FIXME: | |
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8 | |
or | |
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found | |
gem uninstall nokogiri libxml-ruby | |
brew update | |
brew uninstall libxml2 |
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
gem install bundler | |
# 1. Get edge Rails source (master branch) | |
git clone https://github.com/rails/rails.git |