Skip to content

Instantly share code, notes, and snippets.

View pkqk's full-sized avatar
📯
💨 🎶 🎵 🎶

Adam Sven Johnson pkqk

📯
💨 🎶 🎵 🎶
View GitHub Profile
# Hacked from http://github.com/dball/zoomifier/blob/master/lib/zoomifier.rb
require 'fileutils'
require 'open-uri'
require 'rubygems'
require 'rmagick'
require 'rexml/document'
class Zoomify
TILESIZE = 256
@lazyatom
lazyatom / edit_definition.rb
Created January 25, 2011 12:56
Take me to the definition of a method in TextMate
# put this in your .irbrc
class Object
def __edit_method(method_name, object=self)
method = object.method(method_name.to_sym)
`open txmt://open?url=file://#{method.__file__}&line=#{method.__line__}`
end
end
@tomlea
tomlea / start_sql_servers.sh
Created March 3, 2011 13:51
Start a MySQL master/slave pair.
rm -R $HOME/Desktop/server-{1,2}
mkdir -p $HOME/Desktop/server-{1,2}
mysql_install_db --datadir=$HOME/Desktop/server-1 && mysqld --server-id 1 -h ~/Desktop/server-1 --socket ~/Desktop/server-1/mysql.sock -P 10001 --log-bin &
mysql_install_db --datadir=$HOME/Desktop/server-2 && mysqld --server-id 2 -h ~/Desktop/server-2 --socket ~/Desktop/server-2/mysql.sock -P 10002 --master-port=10001 --master-host=127.0.0.1 --master-user=root &
alias sql-master="mysql -h127.0.0.1 -P10001 -uroot"
alias sql-slave="mysql -h127.0.0.1 -P10002 -uroot"
alias sql-master-admin="mysqladmin -h127.0.0.1 -P10001 -uroot"
@twoism-dev
twoism-dev / gist:1183437
Created August 31, 2011 12:38
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@pkqk
pkqk / gist:1183508
Created August 31, 2011 13:11
ssl csr generation
openssl req -newkey rsa:1024 -nodes -keyout myssl.key -out myssl.csr
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline
@attilagyorffy
attilagyorffy / .powenv
Created March 2, 2012 12:20
Easily enable ruby debugger under Pow
export ENABLE_REMOTE_DEBUGGER_UNDER_POW=true
@erik-megarad
erik-megarad / gist:2704272
Created May 15, 2012 19:08
Fuck you. Just... Fuck. you.
Failures:
1) Foo timestamp
Failure/Error: its(:timestamp) { should eql timestamp }
expected: Tue, 15 May 2012 19:06:00 UTC +00:00
got: Tue, 15 May 2012 19:06:00 UTC +00:00
(compared using eql?)

This document is intended to be a simplified version of the OAuth 2.0 specification. In particular it has been written with implementors in mind, and as such attempts to trim the spec down to just what you need to implement an OAuth provider or client. It is necessarily not complete, but attempts to introduce spec requirements in the same order in which the protocol proceeds in practise, with everything you need to know about each protocol endpoint brought together in one place rather than scattered across a large document.

@dankrause
dankrause / ssdp.py
Last active April 25, 2024 13:14
Tiny python SSDP discovery library with no external dependencies
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,