Skip to content

Instantly share code, notes, and snippets.

View jwreagor's full-sized avatar

J R jwreagor

  • New Gillington, WI
View GitHub Profile
if ($.browser.msie) {
var minWidth = parseInt($("div#main").css("min-width").replace(/px/, ""));
$(window).resize(function(e) {
if ($(this).width() <= minWidth) {
$("div#main").width(minWidth);
} else {
$("div#main").css({
width: ""
});
}
@jwreagor
jwreagor / Gemfile
Created January 18, 2010 17:23 — forked from lifo/Gemfile
gem 'cramp'
gem 'erubis', '2.6.5'
gem 'usher', "0.6.0"

Setting up Capybara (w/ @culerity support) using rvm

The following steps will setup ruby 1.8.7-p174 as well as the gems required for Capybara and Culerity support. It will also install Celerity using macports-managed JRuby. Note: sudo is not used.

Steps: $ rvm install 1.8.7-p174 $ rvm 1.8.7-p174 $ gem install rails cucumber capybara webrat rspec cucumber-rails email_spec database_cleaner rspec-rails factory_girl clearance formtastic sqlite3-ruby pg thin mongrel paperclip will_paginate ZenTest autotest-rails culerity $ rvm jruby-1.4.0 $ gem install celerity

<?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>com.hclnet.redis</string>
<key>Program</key>
<string>/usr/bin/redis-server</string>
<key>ProgramArguments</key>
<array>
#! /bin/sh
CUR_DIR=$PWD
PID_FILE="$CUR_DIR/node.pid"
if [ $1 = "start" ]; then
if [ -e $PID_FILE ]; then
echo "Node.js is already running."
else
echo "Starting Node Server"
function copyIntoClipboard(text) {
var flashId = 'flashId-HKxmj5';
/* Replace this with your clipboard.swf location */
//var clipboardSWF = 'http://appengine.bravo9.com/copy-into-clipboard/clipboard.swf';
var clipboardSWF = '/clipboard.swf';
if(!document.getElementById(flashId)) {
var div = document.createElement('div');
This is an example of using RVM's Project .rvmrc file
to have it automatically bootstrap your environment, including bundler.
This could be further expanded to do anything you require :)
The important thing to remember is that the purpose of these files is
to allow you to very easily have your 'project context' (aka 'environment')
loaded automatically for you when you enter the project in the shell (cd).
require 'machinist/datamapper'
# Let's say we have some really simple models for a blog. (I'm using
# DataMapper here, but Machinist works exactly the same way with ActiveRecord.)
class Person
include DataMapper::Resource
property :id, Serial
property :name, String
end
# For "Classic" style/top-level type of apps do something like:
#
# configure :development do
# require File.join(File.dirname(__FILE__), 'sinatra_reloader')
# set :reload_paths, [File.join(File.dirname(__FILE__), '**', '*.rb')]
# end
#
# For "Modular" style/Sinatra::Base subclasses:
#
# configure :development do
# Block Facebook
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 static.ak.fbcdn.net
127.0.0.1 www.static.ak.fbcdn.net
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com