Skip to content

Instantly share code, notes, and snippets.

View rmanalan's full-sized avatar
:octocat:

Rich Manalang rmanalan

:octocat:
View GitHub Profile
@rmanalan
rmanalan / raspi-gmail.py
Created October 16, 2012 05:37 — forked from ladyada/raspi-gmail.py
Raspberry Pi LED E-mail Notifier
cat <<! > raspi-gmail.py
#!/usr/bin/env python
import RPi.GPIO as GPIO, feedparser, time
DEBUG = 1
USERNAME = "username" # just the part before the @ sign, add yours here
PASSWORD = "password"
@rmanalan
rmanalan / hack.sh
Created March 31, 2012 20:02 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@rmanalan
rmanalan / domready.js
Created February 24, 2011 17:08 — forked from ded/domready.js
function r(f){/in/(document.readyState)?setTimeout(r,9,f):f()}
@rmanalan
rmanalan / file.js
Created May 15, 2010 14:33 — forked from jlsync/file.js
$.sammy(function() {
app.get('#/exams/new', function(context) {
// display the modal
window.setTimeout( function(){
context.app.location_proxy.unbind();
context.app.setLocation('#/');
context.app.last_location = '#/';

mustache.vim

In your shell:

cd ~/.vim/syntax
wget http://github.com/defunkt/mustache/raw/master/contrib/mustache.vim

In your ~/.vim/filetype.vim:

runtime! ftdetect/*.vim

Rails 2.3.5 on App Engine (DataMapper)

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TinyDS version also: gist.github.com/269075

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.

sudo gem install google-appengine
@rmanalan
rmanalan / 0what.md
Created August 24, 2009 03:09 — forked from defunkt/0what.md

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

# ~/.bash_profile
export GEMDIR=`gem env gemdir`
gemdoc() {
local gems=($GEMDIR/doc/$1*/rdoc/index.html)
open ${gems[@]: -1}
}
complete -W '$(`which ls` $GEMDIR/doc)' gemdoc
# NAME: authinabox
# VERSION: 1.01 (Dec 27, 2008)
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ]
# DESCRIPTION: An "all in one" Sinatra library containing a User model and authentication
# system for both session-based logins OR HTTP Basic auth (for APIs, etc).
# This is an "all in one" system so you will probably need to heavily tailor
# it to your own ideas, but it will work "out of the box" as-is.
# COMPATIBILITY: - Tested on 0.3.2 AND the latest rtomayko Hoboken build! (recommended for the latter though)
# - NEEDS DataMapper!
# - Less work needed if you use initializer library -- http://gist.github.com/40238
@rmanalan
rmanalan / passenger paperclip imagemagick issue (identify)
Created January 17, 2009 04:12
OS X Passenger/Apache PATH vars
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin</string>
</dict>