Skip to content

Instantly share code, notes, and snippets.

@kyledrake
kyledrake / keybase.md
Created Jun 6, 2014
Verification of my PGP key on Keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am kyledrake on github.
  • I am kyledrake (https://keybase.io/kyledrake) on keybase.
  • I have a public key whose fingerprint is 9C30 FA7B EA38 CBCD AB4D B12C 8BE7 2107 2E18 64BE

To claim this, I am signing this object:

@kyledrake
kyledrake / test.js
Created Jul 31, 2014
Testing darkwallet/stealth.js
View test.js
var stealth = require('stealth.js')
var b = require('bitcoinjs-lib')
// Receiver generates a scan and spend keypair
var receiverScanPrivateKey = new b.ECKey(undefined, true)
var receiverScanPublicKey = receiverScanPrivateKey.getPub()
var receiverSpendPrivateKey = new b.ECKey(undefined, true)
var receiverSpendPublicKey = receiverSpendPrivateKey.getPub()
View gist:4cb1325461b040b07d66
# The Nginx configuration based on https://coderwall.com/p/rlguog
http {
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 15m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
View gist:3af997f6f58d4d58f728
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
@kyledrake
kyledrake / paypal.rb
Last active Aug 29, 2015
A not-crazy Paypal REST API interface.
View paypal.rb
# Everything else was worse...
# https://developer.paypal.com/docs/api/
require 'rest_client'
require 'addressable/uri'
require 'thread'
class Paypal
OAUTH2_IS_INCREDIBLY_SHITTY_COMEDY_TIME_PADDING = 10
SANDBOX_URI = Addressable::URI.parse 'https://api.sandbox.paypal.com/v1'
LIVE_URI = Addressable::URI.parse 'https://api.paypal.com/v1'
View gist:1007336
require 'rubygems'
require 'sinatra'
require 'geoloqi'
GEOLOQI_REDIRECT_URI = 'http://yourwebsite.net'
enable :sessions
configure do
Geoloqi.config :client_id => 'YOUR OAUTH CLIENT ID', :client_secret => 'YOUR CLIENT SECRET'
@kyledrake
kyledrake / gist:1128433
Created Aug 5, 2011
Rubinius day web server parallelism benchmarking tests
View gist:1128433
### TEST 1: Simple Rack app RAW AND DUMB
class HelloRubinius
def call(env)
return [
200,
{'Content-Type' => 'text/html'},
['Hello #rbxday!']
]
end
@kyledrake
kyledrake / config.ru
Created Aug 23, 2011
Debugging Kirk $stderr issue
View config.ru
require 'rubygems'
require 'sinatra/base'
require 'kirk'
require 'ruby-debug'
run Sinatra.new {
get '/' do
# debugger
$stdout.puts 'Testing $stdout!'
$stderr.puts 'Testing $stderr!'
'hi'
@kyledrake
kyledrake / gist:1566576
Created Jan 5, 2012
Fix for AWS::S3 thread safety issues
View gist:1566576
require 'aws/s3'
class D7Obj < AWS::S3::S3Object
set_current_bucket_to "kd-test"
end
class S3Handler
AWS::S3::Base.establish_connection!(
:access_key_id => 'ID',
@kyledrake
kyledrake / paranoid_delete.rb
Created Feb 22, 2012
Quick and dirty "paranoid delete" for Sequel
View paranoid_delete.rb
module Sequel
module ParanoidDelete
def self.included(base)
base.extend(ClassMethods)
end
# Instead of actually deleting, we just set is_deleted to true,
# and look for it with our default dataset filter.
def delete