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 Hash | |
alias :__values :values | |
def values | |
self["values"] || __values | |
end | |
alias :__method_missing :method_missing | |
def method_missing(name, *args, &block) | |
if args.empty? | |
self[name.to_s] || self[name] |
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 GCMiddleware | |
def initialize(app, options={}) | |
@app = app | |
@options = options | |
end | |
def call(env) | |
begin_gc_deferment | |
result = @app.call(env) | |
reconsider_gc_deferment(env) |
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
14:23 ~/projects/work/rentals master rake | |
(in /home/jan/projects/work/rentals) | |
warning: metric_fu gem desired but not found. | |
/home/jan/.rvm/gems/ruby-1.8.7-p352/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement | |
/home/jan/projects/work/rentals/lib/endeca/dimension.rb:3: undefined method `reader' for Endeca::Dimension:Class (NoMethodError) | |
from /home/jan/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' | |
from /home/jan/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' | |
from /home/jan/projects/work/rentals/config/initializers/requires.rb:1 | |
from /home/jan/projects/work/rentals/config/initializers/requires.rb:1:in `each' | |
from /home/jan/projects/work/rentals/config/initializers/requires.rb:1 |
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
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb | |
index 5747a13..c5c9a05 100644 | |
--- a/app/controllers/admin/users_controller.rb | |
+++ b/app/controllers/admin/users_controller.rb | |
@@ -12,8 +12,7 @@ class Admin::UsersController < AdminController | |
@email = Email.new(email: @identity.email, confirmed: true) | |
@user = User.create!(name: @identity.name, nickname: @identity.nickname, | |
emails: [@email]) | |
- # create the membership for other domain user. | |
- Membership.create!(:account => account, :email => @email) unless account.membership_for(@user) |
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
import XMonad hiding ( (|||) ) | |
import XMonad.Actions.CopyWindow | |
import XMonad.Actions.CycleWS | |
import XMonad.Actions.NoBorders | |
import XMonad.Actions.Submap | |
import XMonad.Actions.Search | |
import XMonad.Actions.WindowBringer (bringWindow) | |
import XMonad.Config.Gnome | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.ManageHelpers |
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
Summary: Rubygem Passenger and its Apache2 module | |
Name: passenger-httpd | |
Version: 3.0.11 | |
Release: 1 | |
Vendor: Socialspring, Inc | |
Group: System Environment/Daemons | |
License: Modified BSD | |
URL: http://www.modrails.com/ | |
Source: http://rubyforge.org/frs/download.php/75548/passenger-3.0.11.tar.gz | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot-%(%{__id_u} -n) |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Analog Clock</title> | |
<script> | |
function updateTime() { // Update the SVG clock | |
var now = new Date(); | |
var sec = now.getSeconds(); | |
var min = now.getMinutes(); | |
var hour = (now.getHours() % 12) + min/60; |
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
#!/usr/bin/python2 | |
USAGESTR = """Usage: fetchsub.py [-l langcode] videofile1 [videofile2 ...] | |
langcode: chn [default] | |
eng | |
sub file will saved in the same directory of each videofile | |
XXXXXXX.mkv 's sub files will named as: | |
XXXXXXX.chn.0.srt, XXXXXXX.chn.1.srt, XXXXXXX.chn.2.srt | |
""" | |
"""Author: sevenever |
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
# RFC2616 10.3.3 | |
# If the 302 status code is received in response to a request other | |
# than GET or HEAD, the user agent MUST NOT automatically redirect the | |
# request unless it can be confirmed by the user, since this might | |
# change the conditions under which the request was issued. | |
# Note: RFC 1945 and RFC 2068 specify that the client is not allowed | |
# to change the method on the redirected request. However, most | |
# existing user agent implementations treat 302 as if it were a 303 | |
# response, performing a GET on the Location field-value regardless |
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 A | |
def method_missing(m, *args) | |
n = m.to_s.split('_')[1].to_i | |
send "print_#{n-1}" | |
puts n | |
end | |
def print_1 | |
puts 1 | |
end |