Skip to content

Instantly share code, notes, and snippets.

/*
mff.bookmarklet.css
version 0.0.1
*/
#mff-netflix-control-panel {
background-color: #ddd;
border: 1px solid red;
border-radius: 6px;
position: absolute;
/* mff.bookmarklet
version 0.0.6
*/
// Lazy initialize our namespace context: mff.bookmarklet
if (typeof(mff) == 'undefined') mff = { };
if (typeof(mff.cookie) == 'undefined') mff.cookie = { };
Base64 = {_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+S
@techarch
techarch / .bashrc
Created September 24, 2011 17:28
Custom Pik configuration for Git Bash (MinGW32) on Windows
# Add the following line to your existing .bashrc
# Note the double quotes on the path next to source
[[ -s $USERPROFILE/.pik/.pikrc ]] && source "$USERPROFILE/.pik/.pikrc"
# These are the basic steps to use the twitter gem from @jnunemaker
#
# 1. Install the gem: gem install twitter
#
# 2. Login to Twitter and register your application.
#
# Note: it looks like you cannot use a url like http://locahost:3301/ (bummer)
# An easy alternative is to create an app on Heroku.
#
# IMPORTANT: Make sure that the callback url looks like this:
# Prerequisites:
# 1) Install VIM
# 2) gem install interactive_editor
# -------------------------
require 'rubygems'
require 'interactive_editor'
DEFAULT_IRB_SESSION_FILE = 'my_irb_session.rb'
# 15-minutes with IronRuby and MongoDB
# ------------------------------------
# Prerequisites:
# 1) Download and extract the IronRuby zip from http://ironruby.net/download to C:\ironruby-1.0v4
# 2) Add the C:\ironruby-1.0v4\bin folder of your IronRuby installation folder to your PATH system environment variable
#
# 3) Download and extract the MongoDB for Windows zip from http://www.mongodb.org/display/DOCS/Downloads to C:\MongoDB
# 4) Create a C:\data\db directory
# 5) Start the mongod.exe from the bin folder of your MongoDB installation folder
#
gem 'camping' , '>= 2.0'
gem 'mongo', '= 1.0' #Using 1.0 since MongoMapper explicitly
%w(rack camping mongo mongo_mapper).each { | r | require r}
Camping.goes :MongoTest
module MongoTest
def self.create
MongoMapper.connection = Mongo::Connection.new
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.fcgi/$1 [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]
ErrorDocument 500 "Application error: Ruby Camping application failed to start properly
#!/usr/bin/env ruby
require 'rubygems'
#require 'ruby-debug' # @techarch : commented out since only needed for local debugging
require 'markaby' # @techarch : added explicit require
require 'camping' # @techarch
require 'camping/session' # @techarch : added explicit require since session has changed in Camping 2.0
gem 'RedCloth' # @techarch : added since it is referenced in the Posts model
module MyApp::Controllers
class Test1 < R '/test1'
end
class Test2 < R '/test2'
end
SITE_BASE_URL = "http://www.myapp.com"
# --- --- ---