Skip to content

Instantly share code, notes, and snippets.

View cre-o's full-sized avatar
🏡
Working from home

Sergey Shukhta cre-o

🏡
Working from home
View GitHub Profile
@cre-o
cre-o / gist:3646204
Created September 5, 2012 22:19
Setup RVM, rails, nginx, git, mysql5 on ubuntu-10.04 lucid64
# update apt-get
sudo apt-get update
# if you have troubles with locale in console
sudo locale-gen en_US.UTF-8
# Install common libs
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# Installing rvm with rails
@cre-o
cre-o / sexytabs.css.scss
Created September 5, 2012 22:26
Sexy CSS tabs with css figures
// SEXY TABS
$default_font: "Tahoma";
.sexy-tabs {
height: 40px;
ul {
display: block;
height: 40px;
@cre-o
cre-o / application.rb
Created September 6, 2012 08:26
Rails timezones i18n russian
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib)
# Setup default locale
config.i18n.default_locale = :ru
@cre-o
cre-o / gist:3653698
Created September 6, 2012 09:26
SpeedUp WEBrick when using with vagrant
SSH into vagrant
# If you install rvm as user
# Find your version of rubies
# Like => ~/.rvm/rubies/ruby-<version>/lib/ruby/<version>/webrick/config.rb
# for me it was ~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/config.rb
nano ~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/config.rb
# If you install rvm as root
nano /usr/lib/ruby/<version>/webrick/config.rb
@cre-o
cre-o / gist:3660661
Created September 6, 2012 21:56
Отладка api.vk.com на локалке
# Устанавливаем гем, собственно который и делает всю красоту
# https://github.com/progrium/localtunnel
gem "localtunnel", "~> 0.3" # В Gemfile
# Устанавливаем
bundle install # или просто bundle
# Указываем публичный ключ и порт, на котором будем работать
localtunnel -k ~/.ssh/id_rsa.pub 3000
@cre-o
cre-o / gist:3668033
Created September 7, 2012 17:36
Ubuntu timezone change
# Simple install tzdata
sudo apt-get install tzdata
# Simple select your timezone
sudo dpkg-reconfigure tzdata
# Nice
@cre-o
cre-o / gist:3744203
Created September 18, 2012 16:42
Rails, зарвезервировано!
Итак, в рельсах зарезирвированы следующие названия
:type в бд - single table inheritance
:frozen в бд - active_record
Модели с названием :file(s), соответственно и таблицы не рекомендуется так называть.
@cre-o
cre-o / default.vcl.pl
Created September 22, 2012 00:43 — forked from bmarini/default.vcl.pl
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)
@cre-o
cre-o / script.md
Created September 23, 2012 23:42 — forked from torgeir/install_redis_on_ubuntu.md
Redis 2.4.8 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
@cre-o
cre-o / gist:3773480
Created September 23, 2012 23:54
Last redis ubuntu 10.04
aptitude install python-software-properties
//Добавляем репу с последним редисом
add-apt-repository ppa:rwky/redis
//Обновляем список пакетов
aptitude update
//Устанавливаем
aptitude install redis-server