Skip to content

Instantly share code, notes, and snippets.

View wtn's full-sized avatar

William T. Nelson wtn

  • United States
View GitHub Profile
@MichaelCurrin
MichaelCurrin / README.md
Last active March 6, 2024 10:19
Twitter GraphQL sample

Twitter GraphQL sample

Example of using a GraphQL service to explore the Twitter API

A great way to explore the Twitter API and returned data, without worrying about authorization or local setup. Just add a query in the explorer and hit run.

About

The GraphQL Hub website has an interactive GraphiQL service which allows access to Gitub, Twitter, Giphy and other APIs in the browser without authorization.

@jamieweavis
jamieweavis / macos-app-icon.md
Last active April 28, 2024 02:04
How to create an .icns macOS app icon
@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
@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.
@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
anonymous
anonymous / gist:40a7472abe264884768f
Created August 14, 2014 01:02
KanKen DS3 question extract
// タンポポの{綿毛}が風にふかれて飛ぶ。
// わたげ
// 植物のくきは上の方へのびる{性質}がある。
// せいしつ
// 手あらいをよくして伝染<せん>病を{防}ぐ。
// ふせ
// 父は{常}に「腹<はら>八分目」を心がけている。
// つね
// 母は{雑用}が多くてこまっているようだ。
// ざつよう

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

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.

@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
@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
...