Skip to content

Instantly share code, notes, and snippets.

View mattnwa's full-sized avatar
🏠
Working from home

Matt Luker mattnwa

🏠
Working from home
  • Bentonville, Ar
View GitHub Profile
// Bonfire: Where do I belong
// Author: @mattnwa
// Challenge: http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function where(arr, num) {
// Find my place in this sorted array.
arr.push(num);
arr.sort(function(a,b){
return a-b;
@mattnwa
mattnwa / upsert-benchmark.rb
Created August 23, 2017 20:44
Benchmarking upsert gem vs. find_or_create + update rails
# require 'benchmark/ips'
Benchmark.ips do |x|
# the warmup phase (default 2) and calculation phase (default 5)
x.config(:time => 5, :warmup => 2)
Times = 500
times = Times
def upsert(id)
Score.upsert({scoreable_id: 7864, scoreable_type: 'FacebookPage'}, raw_value: 1234)
end
@mattnwa
mattnwa / ssl_puma.sh
Created November 5, 2018 22:05 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@mattnwa
mattnwa / keybase.md
Last active September 10, 2019 17:02
keybase.md

Keybase proof

I hereby claim:

  • I am mattnwa on github.
  • I am mluker001 (https://keybase.io/mluker001) on keybase.
  • I have a public key ASC-o49bG946FhZ7W7Wl6Hg1MBT6LY326NoKrmFj3d3xkwo

To claim this, I am signing this object: