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 / 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 / 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
actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
aws-s3 (0.6.3)
builder (3.0.0)
bundler (1.2.0)
geoip (1.1.2)
haml (2.2.23)
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
#!/bin/bash
filename=$(basename $TM_FILEPATH)
filename=${filename%.*}
${TM_COFFEE:=coffee} -sc | cat > "$TM_DIRECTORY/$filename.js"
echo "Compiled"
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
@dzhulk
dzhulk / request.rb
Created May 18, 2012 15:24 — forked from steved/request.rb
Eventmachine Deferrable example
require 'httparty'
require 'eventmachine'
class Request
include EM::Deferrable
@@requests = []
attr_reader :method, :params
@dzhulk
dzhulk / config.ru
Created March 2, 2012 11:07
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
require "rails"
@dzhulk
dzhulk / gist:1261446
Created October 4, 2011 11:50
add encoding line
#!/usr/bin/env ruby
require "find"
def file_list(dir, parent_dir=nil)
list = []
Find.find("./#{dir}").map do |file|
unless File.directory? file
list << file
end
end
@dzhulk
dzhulk / gist:1105505
Created July 25, 2011 23:13
Ruby Style Guide
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom