Skip to content

Instantly share code, notes, and snippets.


Paul R Alexander palexander

View GitHub Profile
palexander / .profile
Created Mar 25, 2020 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
View .profile
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
palexander / GPG and git on
Created Mar 25, 2020 — forked from danieleggert/GPG and git on
How to set up git to use the GPG Suite
View GPG and git on

GPG and git on macOS


No need for homebrew or anything like that. Works with and the command line.

  1. Install -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
palexander /
Created Mar 25, 2020 — forked from xavierfoucrier/
GPG signing with Git and Github Desktop

Hi Github users,

You can now signed your commits on Github using at least Git 2.18.0 and Github Desktop 1.6.1.

  1. Generate a GPG key and add it to Github: (if you don't want to type a passphrase on every commit, you need to press "Enter" when the console will prompt you to type a passphrase)

  2. Configure Git properly by editing the .gitconfig file using the command line git config --global --edit in a terminal, then replace YOUR_GITHUB_EMAIL, YOUR_SIGNING_KEY and GPG_BINARY_PATH with your data

# Install Spark on CentOS 7
yum install java -y
java -version
yum install wget -y
tar xvf scala-2.11.7.tgz
sudo mv scala-2.11.7 /usr/lib
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala
palexander / benchmark_dbs_vs_marshal.rb
Created Apr 28, 2015
Benchmark Ruby storage mechanisms
View benchmark_dbs_vs_marshal.rb
def time_code(name, &block)
t1 =
puts "#{name}: #{( - t1).to_f.round(2)}s"
def time_code_aggregate(name, &block)
unless @tc_at_exit
at_exit do
@tc_timers.each do |name, time|
palexander / expand_labels.go
Created Sep 18, 2014
Find RXNORM ingredients and brand names then expand the labels across CUI mappings to NCI and SNOMEDCT_US
View expand_labels.go
package main
import ""
import "log"
func main() {
// Filters for queries
rxnorm := toEntries("RXNORM")
rxnormTTY := toEntries("IN", "BN")
expandedTTY := toEntries("AB", "PT", "SY")
palexander / 0_reuse_code.js
Created Jun 3, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
palexander / header_data.txt
Last active Aug 29, 2015
Example format for NCBO multipart/mixed ontology submission with file
View header_data.txt
Content-Type: multipart/mixed; boundary=OntologiesAPIMultipartPost; type=application/json; start=json
Content-Length: 328853
palexander / ruby_optional_arguments_benchmark.rb
Last active Jan 4, 2016
Benchmark to compare hash and keyword arguments in method invocations
View ruby_optional_arguments_benchmark.rb
require 'benchmark'
COUNT = 10_000_000
NAME = "Test Name"
EMAIL = ""
class Person
attr_accessor :name, :email
def set_with_hash(options = {})
palexander / ruby_data_object_comparison.rb
Created Jan 24, 2014
Benchmark to compare hash, OpenStruct, struct, and classes in Ruby
View ruby_data_object_comparison.rb
require 'ostruct'
require 'benchmark'
COUNT = 10_000_000
NAME = "Test Name"
EMAIL = ""
class Person
attr_accessor :name, :email
You can’t perform that action at this time.