Skip to content

Instantly share code, notes, and snippets.

View README.rdoc

Rails 3.0.pre on App Engine

You can Rails 3 on App Engine, but it won't be especially useful until bundler 10. You should try these instead:

Install the Development Environment

The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.

View pastie.rb
require 'net/http'
require 'uri'
module Redcar
class Pastie
def self.keymaps
linwin = Keymap.build("main", [:linux, :windows]) do
link "Ctrl+Shift+P", Pastie::PasteSelection
@stevenh512
stevenh512 / threadfix.rb
Created Sep 20, 2011
Monkey-patch Ruby 1.9.2 Thread class to try to fix issue #5342
View threadfix.rb
# Monkey-patch Ruby 1.9.2 Thread class to try to fix issue #5342
#
# http://redmine.ruby-lang.org/issues/5342
require 'thread'
class ConditionVariable
def wait(mutex, timeout=nil)
begin
# TODO: mutex should not be used
@waiters_mutex.synchronize do
@stevenh512
stevenh512 / redis_on_tiger.diff
Created Oct 3, 2011
redis on osx tiger(ppc)
View redis_on_tiger.diff
diff --git a/Makefile b/Makefile
index 5219a63..4f9cfad 100644
--- a/Makefile
+++ b/Makefile
@@ -10,10 +10,10 @@ ifeq ($(uname_S),SunOS)
CCLINK?= -ldl -lnsl -lsocket -lm -lpthread
else
CFLAGS?= -std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
- CCLINK?= -lm -pthread
+ CCLINK?= -lm -lpthread
@stevenh512
stevenh512 / 0001-stop-using-like.patch
Created Mar 29, 2012
Patches for acts-as-taggable-on
View 0001-stop-using-like.patch
From 5d61df52623fe0950cdcf99a831508bdd2dacb76 Mon Sep 17 00:00:00 2001
From: Raphael Sofaer <raphael@joindiaspora.com>
Date: Fri, 11 Mar 2011 13:28:53 -0800
Subject: [PATCH 1/4] Stop using LIKE to do case insensitivity, instead just
downcase everything on the way in. Tests now pass with
a utf8_bin collation in MYSQL
---
lib/acts_as_taggable_on/tag.rb | 21 +++++++++++++--------
spec/spec_helper.rb | 2 +-
@stevenh512
stevenh512 / jasmine-prepare
Created Mar 29, 2012
Prepare Diaspora's Jasmine fixtures
View jasmine-prepare
#!/bin/sh
rm -rf tmp
mkdir tmp
echo "Migrating database"
echo "bundle exec rake db:migrate"
bundle exec rake db:migrate
echo "bundle exec rake db:test:prepare"
bundle exec rake db:test:prepare
echo "Building Jasmine fixtures"
echo "bundle exec rspec spec/controllers/jasmine_fixtures"
@stevenh512
stevenh512 / test.log
Created Mar 30, 2012
Log of Diaspora's features/tags.feature with latest acts_as_taggable_on gem
View test.log
New Relic Agent not running.
New Relic Agent not running.
(0.2ms) BEGIN
(0.2ms) COMMIT
(47.6ms) SELECT @@FOREIGN_KEY_CHECKS
(0.2ms) SET FOREIGN_KEY_CHECKS = 0
(19.3ms) SELECT DATABASE() as db
(216.0ms) select table_name from information_schema.views where table_schema = 'diaspora_test'
(462.3ms) TRUNCATE TABLE `account_deletions`;
(348.2ms) TRUNCATE TABLE `aspect_memberships`;
@stevenh512
stevenh512 / test.log
Created Mar 30, 2012
Log of Diaspora's features/follows_tags.feature and features/tags.feature with latest acts_as_taggable_on gem
View test.log
New Relic Agent not running.
New Relic Agent not running.
(0.2ms) BEGIN
(0.2ms) COMMIT
(47.6ms) SELECT @@FOREIGN_KEY_CHECKS
(0.2ms) SET FOREIGN_KEY_CHECKS = 0
(19.3ms) SELECT DATABASE() as db
(216.0ms) select table_name from information_schema.views where table_schema = 'diaspora_test'
(462.3ms) TRUNCATE TABLE `account_deletions`;
(348.2ms) TRUNCATE TABLE `aspect_memberships`;
@stevenh512
stevenh512 / stripcolor
Created Mar 30, 2012
Strip color codes from Rails logs
View stripcolor
#!/bin/sh
# Strip color codes from Rails logs
# Examples:
# stripcolor test.log > test.log.nocolor # Save a copy of the log without color
# stripcolor test.log | gist # Gist the log
# stripcolor test.log | pbcopy # Copy the log to the clipboard in OSX
# stripcolor test.log | xclip -selection clipboard # Copy log to clipboard in Linux
cat "$@" | sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g"
@stevenh512
stevenh512 / apple-shadow.css
Created May 18, 2012 — forked from nrrrdcore/apple-shadow.css
Bending Shadows Backwards: Apple.com's Container CSS Sorcery
View apple-shadow.css
.shadow-stuff {
-moz-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px;
-webkit-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px;
border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px;
-moz-box-shadow: rgba(0,0,0,.30) 0 2px 3px;
-webkit-box-shadow: rgba(0,0,0,.30) 0 2px 3px;
box-shadow: rgba(0,0,0,.30) 0 2px 3px;
}
.container {
You can’t perform that action at this time.