Skip to content

Instantly share code, notes, and snippets.

View lest's full-sized avatar

Sergey Nartimov lest

View GitHub Profile
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
@lest
lest / lolcat.hs
Created September 5, 2011 20:45
simple lolcat powered by haskell
import Data.Word
freq = 0.3
spread = 8.0
unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int
unbase base r g b = (fi r*base+fi g)*base+fi b
where fi = fromIntegral
-- | Approximate a 24-bit Rgb colour with a colour in the xterm256 6x6x6 colour cube, returning its index.
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
~/code/test_rails_app % RBXOPT=-X19 ~/code/rubinius/bin/rbx script/rails s 23:12
/Users/lest/code/rubinius/lib/rubygems/custom_require.rb:29:in `require':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
=> Booting WEBrick
=> Rails 3.2.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Rails Error: Unable to access log file. Please ensure that /Users/lest/code/test_rails_app/log/development.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
[2011-12-02 23:17:08] INFO WEBrick 1.3.1