Skip to content

Instantly share code, notes, and snippets.

View wtn's full-sized avatar

William T. Nelson wtn

  • United States
View GitHub Profile
@jotto
jotto / how_to_make_quickbooks_qbo.txt
Created November 3, 2010 19:56
QUICKBOOKS OL-222
Quickbooks OL-222 error help
Quickbooks QBO files are based on the OFX spec.
Instead of reading the spec, here are the actual real
world rules since Intuit doesn't appear to care about documentation or helping.
This is particularly useful if you want to avoid the "OL-222" error when
trying to import your own QBO files.
<STMTTRN>
require 'rubygems'
require 'httparty'
class NFLStream
attr_accessor :current_scores
include HTTParty
format :json
base_uri "http://www.nfl.com"
@iboard
iboard / workaround_mongo_associations.rb
Created February 12, 2011 10:55
Workaround for mongo-id-associations
class Author
include Mongoid::Document
include Mongoid::Timestamps
...
references_and_referenced_in_many :institutes
after_save :update_institutes #WORKAROUND
...
private
...
@kazpsp
kazpsp / passwords_controller.rb
Created August 14, 2012 16:40 — forked from guilleiguaran/passwords_controller.rb
StrongParameters with Devise
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
private :resource_params
end

The server.rb file slowly feeds data to the socket, and both clients will yield data as it's available. UneventfulMachine steals the API of EventMachine.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

anonymous
anonymous / gist:40a7472abe264884768f
Created August 14, 2014 01:02
KanKen DS3 question extract
// タンポポの{綿毛}が風にふかれて飛ぶ。
// わたげ
// 植物のくきは上の方へのびる{性質}がある。
// せいしつ
// 手あらいをよくして伝染<せん>病を{防}ぐ。
// ふせ
// 父は{常}に「腹<はら>八分目」を心がけている。
// つね
// 母は{雑用}が多くてこまっているようだ。
// ざつよう
@murbanski
murbanski / api_clients_controller_spec.rb
Last active February 27, 2024 19:53
RSpec 3.1 and Rails 4 HTTP Digest Auth testing
# spec/controllers/api_clients_controller_spec.rb
RSpec.describe APIClientsController, type: :controller do
let(:api_client) { mock_model(APIClient) }
context "when HTTP Digest auth credentials are invalid" do
before do
authenticate_with_http_digest("invalid_login", "invalid_password") do
get :index
end
end
@thom-nic
thom-nic / chunked_transfer_decoder.rb
Last active February 5, 2020 15:23
Rack middleware to decode chunked transfer HTTP request
#require 'rack/request'
# Rack middleware to decode a `Transfer-Encoding: chunked` HTTP request.
#
# USAGE NOTE:
#
# Some HTTP servers (Webrick and Unicorn/Rabinbows/Zbatery) already decode the
# chunked stream, but they leave the 'Transfer-Encoding' header and don't bother
# to add a 'Content-Length' header, which causes rails ActionDispatch::Request
# to not parse the whole request body.
@x011
x011 / Interactive Brokers Equities (NASDAQ, NYSE, AMEX) - Symbol, Primary Exchange, Tick Increment, ISIN, CONID, ASSETID.txt
Last active March 28, 2024 20:00
Interactive Brokers Equities (NASDAQ, NYSE, AMEX) - Symbol, Primary Exchange, Tick Increment, ISIN, CONID, ASSETID
symbol,exch,tick,isin,conid,assetid
OGEN,AMEX,0001,US6840232036,79502228,IB14002948
AZRX,NASDAQ,01,US05502L1052,249028358,IB44916495
SLIM,NASDAQ,01,US47103U5065,236317253,IB42908076
SPNC,NASDAQ,05,US84760C1071,274605,IB49346
SLMAP,NASDAQ,01,US78442P2056,2009074,IB24382
ISCA,NASDAQ,05,US4603352018,4596071,IB47153
JASN,NASDAQ,0001,US4711721062,159114177,IB28671428
PMD,NASDAQ,01,US7443752057,756145,IB82271
SPAN,NASDAQ,01,US8463961099,274554,IB49331