This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Proc | |
def bind(object) | |
block, time = self, Time.now | |
(class << object; self end).class_eval do | |
method_name = "__bind_#{time.to_i}_#{time.usec}" | |
define_method(method_name, &block) | |
method = instance_method(method_name) | |
remove_method(method_name) | |
method | |
end.bind(object) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From fad23f414a762d74bdcd77290ef206110327bb46 Mon Sep 17 00:00:00 2001 | |
From: Dmitry Maksimov <[email protected]> | |
Date: Tue, 16 Mar 2010 08:47:04 +0300 | |
Subject: [PATCH] Basic implementation of git-bisect | |
--- | |
lib/grit.rb | 1 + | |
lib/grit/bisect.rb | 37 +++++++++++++++++++++++++++++++++ | |
lib/grit/git.rb | 4 +++ | |
lib/grit/repo.rb | 20 ++++++++++++++++++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
class WelcomeController | |
@@controller = self.new | |
def self.method_missing(name, *args) | |
@@controller.send(name) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = [NAME] | |
email = [EMAIL] | |
[core] | |
autocrlf = false | |
excludesfile = [PATH TO GITIGNORE] | |
[alias] | |
lg = log --format=\"%C(yellow)%h%Creset %s %C(yellow)%an%Creset (%ar)\" --graph | |
co = checkout | |
ci = commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MessageSenderObserver < ActiveRecord::Observer | |
observe :attendee | |
def after_create(model) | |
model.user.post_message(:all, I18n::t("messages.#{model.class.name.underscore}.create", | |
:title => title_for(model), | |
:link => link_for(model))) | |
end | |
private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a file `spec/acceptance/support/warden.rb' with the following | |
# contents: | |
Spec::Runner.configure do |config| | |
config.include Warden::Test::Helpers, :type => :acceptance | |
config.after(:each, :type => :acceptance) { Warden.test_reset! } | |
end | |
# Or, if you're using RSpec 2 / Rails 3, the contents should be the following | |
# instead: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
# | |
# Events | |
# | |
can :update, Event do |event| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'test/unit' | |
TEST_CONFIG = <<END_OF_CONFIG | |
filename: settings.rb | |
development: | |
database: settings-development | |
port: 3366 | |
test: | |
hostname: localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://worldoftanks.eu/community/accounts/api/%API_VER%/?source_token=%TOKEN%&search=%NAME%&offset=0&limit=1 | |
http://worldoftanks.eu/community/accounts/%PLAYER_ID%/api/%API_VER%/?source_token=%TOKEN% | |
http://worldoftanks.eu/community/clans/api/%API_VER%/?source_token=%TOKEN%&search=%CLAN_NAME%&offset=0&limit=1 | |
http://worldoftanks.eu/community/clans/%CLAN_ID%/api/%API_VER%/?source_token=%TOKEN% | |
http://worldoftanks.eu/personal/api/%API_VER%/?source_token=%TOKEN% | |
login req: getlogin: https://worldoftanks.eu/auth/create/api/1.0/?source_token=%TOKEN% | |
gettoken: https://worldoftanks.eu/utils/csrf/api/1.0/?source_token=%TOKEN% | |
api versions: 1.0, 1.1, 1.2, 1.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
SESSION_NAME=${PWD##*/} # Current directory name will be used as session name | |
tmux new-session -d -s $SESSION_NAME | |
tmux new-window -t $SESSION_NAME:1 -n 'vim' 'vim' | |
tmux new-window -t $SESSION_NAME:2 | |
tmux new-window -t $SESSION_NAME:3 |
OlderNewer