Skip to content

Instantly share code, notes, and snippets.

View ntalbott's full-sized avatar
💻
Writing and Coding

Nathaniel Talbott ntalbott

💻
Writing and Coding
View GitHub Profile
@ntalbott
ntalbott / Gemfile
Created December 12, 2012 00:42
Example of Relix that indexes the file system. https://github.com/ntalbott/relix
source "https://rubygems.org"
gem "relix"
gem "ruby-progressbar"
@ntalbott
ntalbott / hipchat-transcript
Created January 25, 2013 15:54
A handy little script to create a text-based transcript from a Hipchat room.
#!/usr/bin/env ruby
require "httparty"
def usage!
puts "Usage: hipchat-transcript <token> <room id> [date]"
exit!
end
TOKEN = (ARGV[0] || usage!)
@ntalbott
ntalbott / test
Last active December 12, 2015 05:08
Test
This is a test gist.
Revised.
@ntalbott
ntalbott / bootstrap.lua
Last active December 12, 2015 05:08
ComputerCraft Gist Filesystem
h = fs.open("/gfs", "w"); h.write(http.get("https://gist.github.com/ntalbott/4719172/raw/gfs.lua").readAll()); h.close();
@ntalbott
ntalbott / inventory.lua
Last active December 12, 2015 05:18
ComputerCraft Repo
function select(slot)
assert(slot <= 16)
turtle.select(slot)
return turtle.getItemCount(slot) > 0
end
function waitFor(slot)
while not select(slot) do
os.sleep(1)
end
module Kernel
def backtrace
caller
end
end
if ENV["STITCH"] == "1"
require "rack-proxy"
class Stitcher < Rack::Proxy
EXACT = %w(/ /terms /privacy)
PREFIX = %w(/pricing /about /support /gateways /assets)
def initialize(app)
@app = app
end
require 'potluck/recipes/smoke'
task :smoke_test do
failed_tests = []
curl_result = `curl -s -w "%{http_code}" https://id.spreedly.com/signin -o /dev/null`
failed_tests << "Id smoke test FAILURE." unless (curl_result == "200")
curl_result = `curl -s -w "%{http_code}" https://spreedly.com/ -o /dev/null`
failed_tests << "Public smoke test FAILURE." unless (curl_result == "200")
@ntalbott
ntalbott / ksync
Created March 12, 2013 04:14
Syncs a directory structure to a non-touch Kindle and writes collections metadata.
#!/usr/bin/env ruby
require "rubygems"
require "pathname"
require "fileutils"
require "json"
require "digest/sha1"
require "awesome_print"
@ntalbott
ntalbott / example.rb
Created October 5, 2013 14:52
Thoughts on wrapping the Realex Vault API for ActiveMerchant
response = store(cc)
token = response.authorization #=> "#{payer_ref}:#{card_ref}"
update(token, {...})