Skip to content

Instantly share code, notes, and snippets.

View srt32's full-sized avatar
πŸ’­
wahoo

Simon Taranto srt32

πŸ’­
wahoo
  • GitHub
  • WORLD
  • 20:32 (UTC -04:00)
View GitHub Profile

docs

To start godoc at log in time (so it always there on port 6060 when you need it):

  1. copy smarticus.godoc.plist to in ~/Library/LaunchAgents
  2. launchctl load ~/Library/LaunchAgents/smarticus.godoc.plist
  3. visit http://localhost:6060
// in this case we inject the database as argument to another package
package httpd
import (
"net/http"
"path/to/db"
)
var db *db.Database
@mitchwongho
mitchwongho / Docker
Last active April 16, 2025 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@srt32
srt32 / install.md
Last active July 18, 2021 23:43
installing PostGIS on OSX

Installing the Postgres PostGIS extension on OSX

For reference: http://postgis.net/install

If you don’t already have PG installed

The most reliable way to get PostGIS on OSX is to download and install Postgres.app. Great for development and testing. Do not mix with other installations. Select the extension when prompted.

If you already have PG installed

@r9y9
r9y9 / nmf.go
Created February 16, 2014 07:59
Non-negative Matrix Factorization (NMF) in Golang
package main
import (
"fmt"
. "github.com/r9y9/go.matrix"
)
// Minimize |Y - HU|^2 st H, U > 0
func NMFEuclid(Y *DenseMatrix, numBasis, numIter int) (*DenseMatrix, *DenseMatrix) {
H := Numbers(Y.Rows(), numBasis, 1.0)
@pengwynn
pengwynn / commit_stats.rb
Last active January 3, 2016 09:59
Example for getting commit additions and deletions via Octokit.rb
require 'octokit'
stats = Octokit.commit('octokit/octokit.rb', '6e0d6ccd5b68173dd030e62f4276793e5d7ce40b').stats
stats.additions
=> 7
stats.deletions
=> 78
@thewatts
thewatts / rails.yml
Last active December 30, 2015 06:59
Teamocil Rails Sample
session:
name: "rails"
windows:
- name: "CODE"
layout: 8590,178x45,0,0{114x45,0,0,3,63x45,115,0,4}
panes:
- cmd: "vim"
focus: true
- cmd: "guard"
- name: "SERVER"
@nellshamrell
nellshamrell / gSchool Regex Resources
Last active March 25, 2016 21:49
Regex Resources for gSchool
Beginning Regex
Intro to Regular Expressions by Michael Fitzgeral
http://www.amazon.com/Introducing-Regular-Expressions-ebook/dp/B008K9OGDA/ref=sr_1_2?ie=UTF8&qid=1374171971&sr=8-2&keywords=Regular+Expressions
Using Regular Expressions in Ruby: Part 1 by Nell Shamrell
https://www.bluebox.net/insight/blog-article/using-regular-expressions-in-ruby-part-1-of-3
Intermediate Regex
@catsby
catsby / shards.yml
Created October 10, 2013 19:12 — forked from eprothro/shards.yml
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs