Skip to content

Instantly share code, notes, and snippets.

View lest's full-sized avatar

Sergey Nartimov lest

View GitHub Profile
~/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
An exception occurred running script/rails
uninitialized constant Encoding::BINARY (NameError)
User defined backtrace:
/Users/lest/code/rails/activesupport/lib/active_support/buffered_logger.rb:66:in `open_log'
/Users/lest/code/rails/activesupport/lib/active_support/buffered_logger.rb:65:in `open_log'
/Users/lest/code/rails/activesupport/lib/active_support/buffered_logger.rb:57:in `initialize'
/Users/lest/code/rails/railties/lib/rails/application/bootstrap.rb:27:in `Bootstrap'
/Users/lest/code/rails/railties/lib/rails/initializable.rb:30:in `run'
/Users/lest/code/rails/railties/lib/rails/initializable.rb:55:in `run_initializers'
~/code/test_rails_app % RBXOPT=-X19 ~/code/rubinius/bin/rbx script/rails console 23:23
/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.
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.
Loading development environment (Rails 3.2.0.beta)
rbx-head :001 > Foo.first
Foo Load (0.7ms) SELECT "foos".* FROM "foos" LIMIT 1
=> #<Foo id: 1, name: nil, created_at: "2011-11-23 19:45:50", updated_at: "2011-11-23 19:45:50">
rbx-head :002 >
@lest
lest / gist:1517325
Created December 24, 2011 13:22
Ruby 1.9.3 with readline and libyaml under rbenv
wget "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz"
tar xf readline-6.2.tar.gz
cd readline-6.2
./configure --prefix=$HOME/.rbenv/versions/1.9.3-p125
make -j 2
make install
cd ..
wget "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
tar xf yaml-0.1.4.tar.gz
# rails command
_script_rails() {
local check_dir=$PWD
while [ "$(dirname $check_dir)" != "/" ]; do
if [ -f "$check_dir/script/rails" ]; then
"$check_dir/script/rails" $@
return
fi
check_dir="$(dirname $check_dir)"
done
#!/bin/sh
REPO="$1"
OUTFILE="$2"
gource -s 2 -i 20 -a 1 --stop-at-end \
--output-ppm-stream - --output-framerate 25 \
--multi-sampling \
--highlight-all-users "$REPO" | \
\
@lest
lest / keybase.md
Created February 29, 2016 20:02
keybase.md

Keybase proof

I hereby claim:

  • I am lest on github.
  • I am lest (https://keybase.io/lest) on keybase.
  • I have a public key ASCweaiuDtlExEa2wDLKY5chKYJNiaa3BHSZobkSCttxWgo

To claim this, I am signing this object:

@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.