Skip to content

Instantly share code, notes, and snippets.

View dzhulk's full-sized avatar

Murat Dzhulkuttiev dzhulk

  • St. Petersburg, Russia
View GitHub Profile
@dzhulk
dzhulk / gist:3958201
Created October 26, 2012 11:01 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dzhulk
dzhulk / Gemfile
Created November 2, 2012 19:16
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@dzhulk
dzhulk / workers.rb
Created November 9, 2012 08:47 — forked from schmurfy/workers.rb
Celluloid workers
require 'celluloid'
WORKERS_COUNT = (ARGV[0] || 1).to_i
class Output
include Celluloid
def puts(msg)
Kernel.puts(msg)
end
@dzhulk
dzhulk / crash
Created November 29, 2012 15:34
crash
rbx -S rails s
==================================== ERROR ====================================
| An extension is trying to add an invalid handle at the following location: |
| v8_handle.cpp:31 |
| |
| An invalid handle means that it points to an invalid VALUE. This can happen |
| when you haven't initialized the VALUE pointer yet, in which case we |
| suggest either initializing it properly or otherwise first initialize it to |
| NULL if you can only set it to a proper VALUE pointer afterwards. Consider |
@dzhulk
dzhulk / gist:4169852
Created November 29, 2012 15:37
rbx report
Rubinius Crash Report #rbxcrashreport
Error: signal SIGILL
[[Backtrace]]
0 rbx 0x0000000108219df0 _ZN8rubiniusL12segv_handlerEi + 544
1 libsystem_c.dylib 0x00007fff8ce1b8ea _sigtramp + 26
2 ??? 0x0000000000000006 0x0 + 6
3 rbx 0x000000010821e198 _ZN8rubinius3bugEPKc + 72
4 rbx 0x00000001083012d8 _ZN8rubinius11SharedState26add_global_handle_locationEPPNS_4capi6HandleEPKci + 1222
create table geoip (id integer, country varchar(19), region varchar(10), city varchar(255), postal_code varchar(255), latitude real, longitude real, metroCode varchar(10), areaCode varchar(10) );
@dzhulk
dzhulk / gist:5217922
Created March 21, 2013 23:59
textmate
defaults write com.macromates.TextMate.preview fileBrowserPlacement right
import java.lang.Character.{ LETTER_NUMBER => CR,LINE_SEPARATOR => LF }
import java.net.InetSocketAddress
import java.nio.channels.AsynchronousChannelGroup._
import java.nio.channels.AsynchronousServerSocketChannel._
import java.nio.channels.{ AsynchronousSocketChannel => ASC }
import java.nio.channels.CompletionHandler
import java.nio.ByteBuffer._
import java.util.concurrent.Executors._
import scala.annotation.implicitNotFound
import scala.collection.mutable.ListBuffer
tmux -u attach || tmux -u new
Checking dependencies for json (1.8.0)
Checking dependencies for rake (10.1.0)
Checking dependencies for rdoc (4.0.1)
Checking dependencies for rubysl-rake (2.0.0)
Checking dependencies for ffi2-generators (0.1.1)
Checking dependencies for rubinius-profiler (2.0.0)
Checking dependencies for rubinius-coverage (2.0.1)
Checking dependencies for rubinius-debugger (2.0.0)
Checking dependencies for rubysl (2.0.7)/Users/murat/.rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/net/http.rb:919:in `connect': SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A (OpenSSL::SSL::SSLError)
from /Users/murat/.rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/net/http.rb:919:in `block in connect'