Skip to content

Instantly share code, notes, and snippets.

View jasp's full-sized avatar
🏠
Working from home

Jakob Skov-Pedersen jasp

🏠
Working from home
View GitHub Profile
@pnc
pnc / observer.md
Last active April 1, 2025 21:38
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@estum
estum / user.rb
Last active December 21, 2015 05:49
Migrate passwords from legacy systems to Devise
# updated variant of older solution:
# http://www.davidverhasselt.com/2012/05/13/how-to-migrate-passwords-from-legacy-systems-to-devise
class User < ActiveRecord::Base
# ...
def valid_password?(password)
if legacy_password?
# Use Devise's secure_compare to avoid timing attacks
@pogodan
pogodan / Gemfile
Created April 24, 2011 14:10
edge rails/3.1 Gemfile
source :rubygems
gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'arel', :git => 'git://github.com/rails/arel.git'
gem 'rack', :git => 'git://github.com/rack/rack.git'
gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git'
gem 'sqlite3'
# Asset template engines
@rheaton
rheaton / tracker_csv_export_to_pdf.rb
Created March 30, 2011 15:38
takes a csv file from tracker and makes story cards. be careful of the order when you are cutting them up.
#!/usr/bin/env ruby
# Script to generate PDF cards suitable for planning poker
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export.
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png
require 'rubygems'
@igrigorik
igrigorik / rack-client-em-http.rb
Created January 30, 2011 01:06
sync / async API with rack-client
require 'rack/client'
require 'yajl'
require 'pp'
require 'eventmachine'
require 'em-synchrony'
require 'em-synchrony/em-http'
module Rack
module Client
@joerichsen
joerichsen / gist:735296
Created December 9, 2010 20:35
A version that works with with the newest savon version
# Old version is here
# https://gist.github.com/657153
# In Gemfile
gem 'savon', :git => 'http://github.com/rubiii/savon.git', :branch => 'eight'
gem 'httpclient'
# Run this in the console to fetch the name and address of the first debtor
HTTPI::Adapter.use = :net_http
client = Savon::Client.new do
@bryanl
bryanl / tmux.conf
Created November 30, 2010 05:17
I copied this from somewhere. It is a good start, though
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@joerichsen
joerichsen / gist:657153
Created October 31, 2010 21:06
Querying the e-conomic.dk API using Savon and Ruby
# In Gemfile
gem 'savon', :git => 'http://github.com/rubiii/savon.git', :branch => 'eight'
gem 'httpclient'
# Run this in the console to fetch the name and address of the first debtor
client = Savon::Client.new do
wsdl.document = "https://www.e-conomic.com/secure/api1/EconomicWebservice.asmx?WSDL"
end
# Authenticate

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.