Skip to content

Instantly share code, notes, and snippets.

View michfield's full-sized avatar

Michael Field michfield

View GitHub Profile
# How to echobot with XMPP, BOSH, and Strophe
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account admin@localhost.local
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this
#/etc/hosts
127.0.0.1 localhost.local
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server.
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0)
@cowboy
cowboy / HEY-YOU.md
Last active July 1, 2024 08:37
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@adamhjk
adamhjk / file_provider_copy.rb
Created August 31, 2011 23:16
Stick this in a library file...
class Chef
class Provider
class File
class Copy << Chef::Provider::File
def compare_content
checksum(@current_resource.path) == checksum(@new_resource.content)
end
@tim-evans
tim-evans / xmpp_data_source.js
Created December 21, 2011 19:13
SC.MultiplexedDataSource
XMPP = {};
// ...............................................
// Models
//
XMPP.BOSHConnection = SC.Record.extend({
primaryKey: 'jid',
jid: SC.Record.attr(String),
password: SC.Record.attr(String),
@tim-evans
tim-evans / xmpp_cascade_data_source.js
Created December 22, 2011 16:45
Cascade XMPP Data Source
XMPP = {};
// ...............................................
// Models
//
XMPP.BOSHConnection = SC.Record.extend({
primaryKey: 'jid',
jid: SC.Record.attr(String),
password: SC.Record.attr(String),
# Cookbook Name:: mongodb
# Recipe:: default
case node['platform']
when "ubuntu"
execute "apt-get update" do
action :nothing
end
execute "add gpg key" do
@ggolin
ggolin / gist:1903209
Created February 24, 2012 19:39
begin rescue end for chef package resource
begin
package some-package
rescue
Chef::Log "Couldn't fine package some-package."
end
require 'Shell'
MEMORY_SIZE = 512
CPU_COUNT = 1
Vagrant::Config.run do |config|
#Install java and cassandra
#config.vm.provision :shell, :path => "install_java.sh"
#config.vm.provision :shell, :path => "install_cassandra.sh"
num_nodes = 3
@jacobsandlund
jacobsandlund / split_opts.sh
Created March 27, 2012 23:17
Split combined short shell options
#!/bin/sh
# This shows how to handle combined short options along with
# other long and short options. It does so by splitting them
# apart (e.g. 'tar -xvzf ...' -> 'tar -x -v -z -f ...')
while test $# -gt 0
do
case $1 in
@davatron5000
davatron5000 / gist:2254924
Created March 30, 2012 20:57
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby