Skip to content

Instantly share code, notes, and snippets.

@codesnik
codesnik / deploy.rb
Created January 14, 2012 02:16 — forked from LRDesign/deploy.rb
Capistrano recipe to sync rails database and files, using remote database.yml instead of local for remote credentials
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
@codesnik
codesnik / script
Created January 10, 2012 09:11 — forked from waaa/script
Script for refunds and charges
#!/usr/bin/env ruby
require 'rubygems'
require 'active_support/core_ext'
require 'rspec'
require 'bigdecimal'
class BigDecimal
def inspect; to_s end
end

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

/* Trivial keyboard input layout to english switcher by Alexander V. Zhouravlev.
* Compile it with gcc -framework Carbon -o SwitchToEnglish SwitchToEnglish.m */
#import <Carbon/Carbon.h>
int main (int argc, const char *argv[])
{
TISInputSourceRef english = TISCopyInputSourceForLanguage(CFSTR("en-US"));
if (!english)
return 1;
ru:
devise:
sessions:
link: 'Войти'
signed_in: 'Вы вошли в систему.'
signed_out: 'Вы вышли из системы.'
unauthenticated: 'Необходимо войти в систему или зарегистрироваться.'
unconfirmed: 'Необходимо подтвердить адрес электронной почты.'
locked: 'Ваша учетная запись заблокирована.'
invalid: 'Неверная учетная запись или пароль.'
#!/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 / 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:
#
• [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"
/*
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
*/
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)/ {