Skip to content

Instantly share code, notes, and snippets.

View mathieugagne's full-sized avatar

Mathieu Gagné mathieugagne

View GitHub Profile
@mathieugagne
mathieugagne / spawn-fcgi
Created March 13, 2013 15:34
/etc/init.d/spawn-fcgi
#!/bin/bash
### BEGIN INIT INFO
# Provides: spawn-fcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts FastCGI for PHP
# Description: starts FastCGI for PHP using start-stop-daemon
@yaraki
yaraki / dijkstra.rb
Created February 3, 2012 13:58
Dijkstra Shortest Path Algorithm in Ruby
#!/usr/bin/ruby1.9.1 -Kw
# -*- coding: utf-8 -*-
class Edge
attr_accessor :src, :dst, :length
def initialize(src, dst, length = 1)
@src = src
@dst = dst
@length = length