Skip to content

Instantly share code, notes, and snippets.

View lest's full-sized avatar

Sergey Nartimov lest

View GitHub Profile
@lest
lest / gist:258021b3212f158b90a7
Created December 8, 2014 18:32
PostgreSQL table sizes
SELECT
table_name,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size
FROM (
SELECT
table_name,
pg_table_size(table_name) AS table_size,
pg_indexes_size(table_name) AS indexes_size,

Keybase proof

I hereby claim:

  • I am lest on github.
  • I am lest (https://keybase.io/lest) on keybase.
  • I have a public key whose fingerprint is 0662 4AEB 6B87 0E19 A71E 47E6 ACB5 8ED0 6F6A 107C

To claim this, I am signing this object:

We couldn’t find that file to show.
@lest
lest / .zshrc
Created March 1, 2010 17:25
.zshrc
[ -f $HOME/.profile ] && . $HOME/.profile
HISTSIZE=2000
SAVEHIST=$HISTSIZE
HISTFILE=$HOME/.zsh_history
setopt append_history
setopt inc_append_history
setopt extended_history
setopt hist_find_no_dups
setopt hist_ignore_all_dups
%% Create N processes in a ring.
%% Send a message round the ring M times so that a total of N * M messages get sent.
-module(ring).
-export([start/0, start/2]).
start() ->
start(10, 10).
start(N, M) ->
class Asset < ActiveRecord::Base
# === List of columns ===
# id : integer
# data_file_name : string
# data_content_type : string
# data_file_size : integer
# assetable_id : integer
# assetable_type : string
# type : string
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@lest
lest / gist:710117
Created November 22, 2010 15:32
Place this to your Capfile
server 'server.host.or.ip.address', :app
set :user, 'user'
set :deploy_to, '/path/to/deploy'
set :repository, 'git repository address'
set :branch, 'origin/master'
namespace :deploy do
desc 'Deploy'
task :default do
require 'benchmark'
def method1(&block)
true if block
end
def method2(&block)
true if block_given?
end
An exception occurred running script/rails
empty range in char class: [\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{10000}-\u{10FFFF}] (RegexpError)
Backtrace:
Regexp#initialize at kernel/common/regexp.rb:95
Class#new at kernel/alpha.rb:94
Sass::SCSS::RX.__module_init__ (RX) at /Users/lest/.rvm/gems/rbx-head/gems
/sass-3.1.10/lib/sass/scss/rx.rb:57
Sass::SCSS.__module_init__ (SCSS) at /Users/lest/.rvm/gems/rbx-head/gems
/sass-3.1.10/lib/sass/scss/rx.rb:7