Skip to content

Instantly share code, notes, and snippets.

# эта хрень подключается так:
# vim --servername 'VIM'
# rdebug -rvim path/to/script
#
# команда v - заставит отобразить текущую файл и строку в запущенном vim-е
#
# Debugger::Command.settings[:autovim]=1 заставит делать это после
# каждого шага
module Debugger
# Implements debugger "list" command.
#!/usr/bin/env ruby
#
# usage: script/server_restarter
#
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
#
# It's quick, simple, and it reliably reloads your application when changes are made.
#
server {
listen 0.0.0.0;
server_name s.ight.ru laresistance.ru;
access_log logs/laresistance.access_log main;
error_log logs/laresistance.error_log info;
root /home/codesnik/apps/laresistance/current/public;
location ~ ^/(images|javascripts|stylesheets|system)/ {
/*
Jquery and Rails powered default application.js
Easy Ajax replacement for remote_functions and ajax_form based on class name
All actions will reply to the .js format
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link
respond_to do |format|
format.html
format.js {render :layout => false}
end
*/
• [syeeda:/tmp/foo] nothingmuch % git init
Initialized empty Git repository in /private/tmp/foo/.git/
• [syeeda:/tmp/foo] nothingmuch % echo foo > foo
• [syeeda:/tmp/foo] nothingmuch % git add foo
• [syeeda:/tmp/foo] nothingmuch % git commit -m "add foo"
[master (root-commit)]: created 403b7b4: "add foo"
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 foo
• [syeeda:/tmp/foo] nothingmuch % git checkout -b contributer
Switched to a new branch "contributer"
# are you tired of getting "ignoring attempt to close body with div" warning
# messages in integration and functional testing? do you hate to find where exactly,
# in which otherwise passed assert_select it pops out?
#
# this patch is for you, then!
#
# it makes such a warning fatal, writes current test responce body to a temp file
# and gives you a path for further inspect.
#
# put this in lib/patch_testprocess.rb
@codesnik
codesnik / commit-msg
Created September 18, 2009 01:47 — forked from henrik/commit-msg
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "t123", automatically
# adds "Refs #123." to commit messages unless they mention "#123" already.
#
# By Henrik Nyh <http://henrik.nyh.se> 2009-09-10 under the MIT License.
#
#
# Install:
#
#!/bin/bash
#
# Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/
#
# Usage: fixconsolas [files ...]
# When called with no arguments, it attempts to operate on every TrueType
# file in the current directory.
#
# References:
# http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042
@codesnik
codesnik / convert_before_commit
Created February 5, 2010 01:14
convert before commit
#!/usr/bin/env zsh
# convert to utf8,
# remove unneccessary utf8 BOM
# add new line at end of file if omitted
# change line terminators to cr from crlf
for f in public/**/*.{css,js,html,htm}; do
mv $f $f.orig
cat $f.orig | \
@codesnik
codesnik / gist:298942
Created February 9, 2010 05:28
zsh function for rails3.0 beta
# allows to use "rails console" style commands while rails3.0 is in beta
function rails {
if [[ -x script/rails ]]; then
script/rails $*
else
command rails $*
fi
}