Skip to content

Instantly share code, notes, and snippets.

View dzhulk's full-sized avatar

Murat Dzhulkuttiev dzhulk

  • St. Petersburg, Russia
View GitHub Profile
#!/bin/bash
# Объявляется функция func, которя обходит
# католог, который передан в качестве аргумента,
# и показывает все файлы в нем и в его подкаталогах
func(){
for fn in `ls $1` # цикл по значениям которые возвращает комманда ls, $1 - это аргумент ф-и
do
if [ "$fn" != "." ] # Условие: если $fn не текущий каталог
then
@dzhulk
dzhulk / rails_3_1_beta_1_changes.md
Created June 8, 2011 16:10 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 Beta 1

  • The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]

  • jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]

  • Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]

  • The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]

:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
@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:
@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 / 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 / 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
#!/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
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
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)