Skip to content

Instantly share code, notes, and snippets.

View johnjohndoe's full-sized avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@demimismo
demimismo / gist:3359506
Created August 15, 2012 11:57
Install Postgresql on Mountain Lion

Install Postgresql on Mountain Lion

Based on: http://coderwall.com/p/1mni7w

brew install postgresql
initdb /usr/local/var/postgres -E utf8
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@garethstockwell
garethstockwell / coloredlogcat.py_missing_tagtypes.diff
Created June 8, 2012 08:01
Add support for missing tag types to coloredlogcat.py
commit bcf3d2c3aeb72f8d295af6d19cfcdaefeb04dd18
Author: Gareth Stockwell <none>
AuthorDate: Fri Jun 8 09:02:18 2012 +0100
Commit: Gareth Stockwell <none>
CommitDate: Fri Jun 8 09:02:18 2012 +0100
Add missing tag types
diff --git a/coloredlogcat.py b/coloredlogcat.py
index d46dbf6..666231f 100644
@mbostock
mbostock / .block
Last active February 11, 2020 15:58 — forked from mbostock/.block
Force-Directed Graph with Mouseover
license: gpl-3.0
@evanbeard
evanbeard / registrations_controller.rb
Created May 11, 2012 19:53 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@marcellodesales
marcellodesales / build.gradle
Created April 24, 2012 10:55
This is a structure of a gradle project that uses a version-controlled Maven repository.
/*
* The plugins used for this build.
*/
/*
* Provides the compile, test, jar, etc tasks
*/
apply plugin: 'java'
/*
* Generates the Eclipse project files.
@lg0
lg0 / markdown.xml
Created April 10, 2012 19:58
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@jonforums
jonforums / download.rb
Created March 26, 2012 01:15
Ruby HTTP/HTTPS/FTP file downloader
#!/usr/bin/env ruby
# An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's
# HTTP implementation.
#
# Author: Jon Maken
# License: 3-clause BSD
# Revision: 2012-03-25 23:01:19 -0600
require 'net/http'
require 'net/https' if RUBY_VERSION < '1.9'
@ptrv
ptrv / trees2sqlite.rb
Created March 15, 2012 00:44
import vienna opendata trees GML file
#!/usr/bin/env ruby
# Get all tree entries from vienna's open data
# service and put them into a sqlite3 database.
#
# Peter Vasil
# Date: 2012-01-15
require 'rubygems'
# require 'rexml/document'
@Abizern
Abizern / pre-commit
Created March 12, 2012 19:00
pre-commit
#!/usr/bin/env sh
# Tidy up whitespace on commit.
# By-pass it with the --no-verify option to git commit
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904