Skip to content

Instantly share code, notes, and snippets.

@boscomonkey
boscomonkey / instapaper.js
Created May 26, 2011 16:09
Read Later bookmarklet that doesn't require a 2nd click
javascript:function iprl5(){var d=document,z=d.createElement('scr'+'ipt'),b=d.body;try{if(!b)throw(0);d.title='(Saving...) '+d.title;z.setAttribute('src','http://www.instapaper.com/j/aoOVr4t2wFMs?u='+encodeURIComponent(d.location.href)+'&t='+(new Date().getTime()));b.appendChild(z);}catch(e){alert('Please wait until the page has loaded.');}}iprl5();void(0)
@boscomonkey
boscomonkey / prep-ejabberd.sh
Created June 6, 2011 23:25
MacPorts installation of ejabberd - Before running ejabberd for the first time, you must copy the sample configuration files:
cd /opt/local/etc/ejabberd/
cp ejabberd.cfg.sample ejabberd.cfg
cp ejabberdctl.cfg.sample ejabberdctl.cfg
cp inetrc.sample inetrc
@boscomonkey
boscomonkey / install-meta-packages.sh
Created June 8, 2011 19:30
Commands to install meta-packages for LAMP and Postgresql on Ubuntu Lucid Lynx
#!/bin/sh
sudo apt-get install lamp-server^
sudo apt-get install postgresql-server^
@boscomonkey
boscomonkey / lcd.rb
Created November 30, 2011 05:18
Ruby Quiz #14 - an evolving solution for SF Ruby Hack night
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
Numbers = [
[" - ",
"| |",
"| |",
"| |",
" - "],
@boscomonkey
boscomonkey / brew-install-mysql.txt
Created December 8, 2011 19:17
"brew install mysql" output on Mac OSX Lion
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
mysql_install_db --help
and view the MySQL documentation:
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
@boscomonkey
boscomonkey / bind_this.js
Created January 21, 2012 21:26
In JavaScript, binds an object to a callback function to use as "this".
// In JavaScript, binds an object to a callback function to use as "this".
//
// When a function is passed as an event callback, "this" is bound to
// the DOM element triggering the event; in other scenarios when a
// function is used as a callback, "this" is bound to the window
// object.
//
// To override the default binding of "this", call bindThis on your
// function. For example:
//
@boscomonkey
boscomonkey / devise-1.5.3-install.txt
Created March 6, 2012 20:39
Devise 1.5.3 gem installation message
===============================================================================
Some setup you must do manually if you haven't yet:
1. Setup default url options for your specific environment. Here is an
example of development environment:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
This is a required Rails configuration. In production it must be the
function getString(str, offset) {
return str.split('')
.map(function(ch) {
return String.fromCharCode(ch.charCodeAt(0) + offset);
})
.join('');
}
javascript:$('#branding img').css('width', '40%');jQuery('#ctaMessage').css('display', 'none');

Cam settings

Before you do anything, perform a factory reset.

Exposure

Shutter: Auto

Brightness: 44 (factory default)