Skip to content

Instantly share code, notes, and snippets.

View jasonm's full-sized avatar

Jason Morrison jasonm

View GitHub Profile
@jasonm
jasonm / gist:194554
Created September 27, 2009 02:10
Faking $stdin for testing in Ruby
require 'test/unit'
class InputFaker
def initialize(strings)
@strings = strings
end
def gets
next_string = @strings.shift
# Uncomment the following line if you'd like to see the faked $stdin#gets
@jasonm
jasonm / 00-README.md
Last active February 7, 2018 07:19
Salesforce API TLS "Verify return code: 20 (unable to get local issuer certificate)"

Starting at Tue 2018-02-06 6:23pmPT we noticed a regular background job which connects to the Salesforce Bulk API via Python client started failing with the following message:

SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

I am able to reproduce the failure to verify (and therefore connect to the API) from outside Python, using the openssl s_client command.

@jasonm
jasonm / 0_reuse_code.js
Created January 20, 2016 02:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
" Opens an edit command with the path of the currently edited file filled in
" Normal mode: <Leader>e
map <Leader>e :e <C-R>=escape(expand("%:p:h"), ' ') . "/" <CR>
" Opens a tab edit command with the path of the currently edited file filled in
" Normal mode: <Leader>te
map <Leader>te :tabe <C-R>=escape(expand("%:p:h"), ' ') . "/" <CR>
" Opens a vsplit command with the path of the currently edited file filled in
" Normal mode: <Leader>ve
" http://stackoverflow.com/questions/762515/vim-remap-key-to-toggle-line-numbering
" source: http://stackoverflow.com/questions/4387210/vim-how-to-map-two-tasks-under-one-shortcut-key
let g:relativenumber = 0
set nonumber
set relativenumber
function! ToggleRelativeNumber()
if g:relativenumber == 0
let g:relativenumber = 1
set number
set norelativenumber
@jasonm
jasonm / .gitignore
Last active December 14, 2015 00:59
*.DS_Store
*.swp
*.swo

So this is nascent thing, linking CVEs to rubygems https://twitter.com/jm/status/301735569527033856

Service idea:

  • Send your Gemfile.lock to a service, get emailed when a pertinent CVE becomes known
  • Easy tie-in via GitHub OAuth and their webhook push API
  • Almost-as-easy tie-in for other platforms (storage and deploy) via after-commit hooks (efficient via etags)
{"followers"=>51,
"type"=>"User",
"url"=>"https://api.github.com/users/jasonm",
"gravatar_id"=>"8478f9ebe099ad853f022deeb2c1defe",
"html_url"=>"https://github.com/jasonm",
"gists_url"=>"https://api.github.com/users/jasonm/gists{/gist_id}",
"followers_url"=>"https://api.github.com/users/jasonm/followers",
"updated_at"=>"2013-01-20T00:41:57Z",
"email"=>"jason.p.morrison@gmail.com",
"hireable"=>true,