This file contains 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
// CSS built for http://kpax.wolf359.be/kpax/dynamic/reddit/reddit-home | |
body { | |
margin: 5px 5px 5px 10px; | |
padding: 0; | |
background: url('bg.gif') 0 0 repeat-x; | |
font:1.1em/1.4em Georgia, Times, serif; | |
color: #464646; | |
background-color: transparent; | |
} |
This file contains 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
# Package Maintainer: Increment phusion_release to match latest release available | |
%define phusion_release 2009.10 | |
Summary: Ruby Enterprise Edition (Release %{phusion_release}) | |
Name: ruby-enterprise | |
Vendor: Phusion.nl | |
Packager: Adam Vollrath <[email protected]> | |
Version: 1.8.7 | |
Release: 2%{dist} | |
License: GPL |
This file contains 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 'nokogiri' | |
# \ | |
# \ | |
# \\ | |
# \\ | |
# >\/7 | |
# _.-(6' \ | |
# (=___._/` \ |
This file contains 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
renderContentOn: html | |
html heading: 'Reddit.st'. | |
html heading level: 3; with: 'In 10 elegant Smalltalk classes'. | |
self renderActionsOn: html. | |
self renderHighestRankingLinksOn: html. | |
self renderLatestLinksOn: html | |
renderActionsOn: html | |
html paragraph: [ | |
html anchor callback: [ ]; with: 'Refresh'. |
This file contains 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
// Save state of UITableView scroll position: | |
save CGPoint contentOffset = self.view.contentOffset; | |
[myWebView stringByEvaluatingJavaScriptFromString:@"window.scrollTo(0,0);"]; |
This file contains 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 'active_support' | |
class Base | |
class_inheritable_accessor :name | |
self.name = "Base" | |
end |
This file contains 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
# destructures the parameter values according to the order of the sorted keys | |
# Usage: | |
# hash = { :macbook => 1, :iphone => 2, :ipad => 3 } | |
# ipad, iphone, macbook = destructuring_bind(hash) | |
def destructuring_bind(hash) | |
hash.sort_by {|k, v| k.to_s }.map {|e| e[1] }.flatten | |
end |
This file contains 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
# see | |
# http://markmail.org/message/zeessthwisaozywf#query:Ruby%20local_variable_set+page:1+mid:zeessthwisaozywf+state:results | |
require 'rubygems' | |
require 'extensions/binding' | |
foo = "bar" | |
puts "foo: " + Kernel.binding["foo"] | |
puts "" |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.redis.redis-server</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/redis/redis-server</string> |
This file contains 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
def rescue_record_invalid(e) | |
logger.info(e) | |
message = e.record.errors.map {|error| | |
"#{t('activerecord.attributes.' + error[0])} #{error[1]}" | |
}.join("\n") | |
respond_to do |format| | |
format.xml { | |
render :status => :unprocessable_entity, |
OlderNewer