Skip to content

Instantly share code, notes, and snippets.

View kastner's full-sized avatar
🕳️
actively choosing...

Erik Kastner kastner

🕳️
actively choosing...
View GitHub Profile
# Lo-fi client for the Facebook API. E.g.:
#
# fb = FacebookClient.new(:api_key => 'api-key', :secret => 'secret')
# fb.call 'users.getInfo', :session_key => 'session-key', :uids => 'user-id', :fields => 'birthday'
#
# by Scott Raymond <[email protected]>
# Public Domain.
#
class FacebookClient
def initialize(default_params={})
@kastner
kastner / 0what.md
Created August 26, 2009 21:18 — 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?

testapp
class WebHook < ActiveRecord::Base
class << self
# Pushes a job onto a queue
def visit!(visit)
JobQueue.new(:events).push({
:type => 'visit',
:visit_id => visit.id,
:user_id => visit.user_id,
<ol class="latest_uploads">
<%= render :partial => "composition", :collection => @playlist.listings.compositions %>
</ol>
//
// StompService.h
// Objective-C Stomp Client
//
// Implements the Stomp Protocol v1.0, as described here: http://stomp.codehaus.org/Protocol
// Requires the AsyncSocket library: http://code.google.com/p/cocoaasyncsocket/
//
// This class is in the public domain.
// by Scott Raymond <[email protected]>.
//
# If cached file exists, serve it and stop processing
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [L]
# other redirection (imgs, js, css, ...)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.*/mephisto/.*
RewriteCond %{REQUEST_URI} !.*html
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1 -f
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="file:///Users/acaldelas/Desktop/Wine Library Concept/Code/wine-lib-script.js"></script>
<link rel="stylesheet"type="text/css"href="wine-lib-styles.css"/>
<title>Wine Library</title>
</head>
Host project1.github.com
HostName github.com
User git # Probably not needed but just a note if you want to skip it
IdentityFile ~/.ssh/your_key_file
IdentitiesOnly yes # This is only if you want to avoid trying other identities which can speed things up a bit.
#!/bin/env ruby
##
# Originally from http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFileChanges.rdoc
# Modified by Geoffrey Grosenbach http://peepcode.com
#
# Watches files and runs a command when any of them are modified.
#
# If one argment is given, will run that command and watch app, lib, test, spec.
#