Skip to content

Instantly share code, notes, and snippets.

View joshnabbott's full-sized avatar

Josh N. Abbott joshnabbott

View GitHub Profile
// Nested ternary
const sortConnectorsFunc = (a, b) =>
// eslint-disable-next-line no-nested-ternary
a.connectorName < b.connectorName ? -1 : a.connectorName > b.connectorName ? 1 : 0;
// Vs if statement
const sortConnectorsFunc = (a, b) => {
if (a.connectorName < b.connectorName) return -1;
if (a.connectorName > b.connectorName) return 1;
return 0;

Keybase proof

I hereby claim:

  • I am joshnabbott on github.
  • I am joshnabbott (https://keybase.io/joshnabbott) on keybase.
  • I have a public key ASBHcB-FC9da6wsTznXsKtIBhtXys68komkPOW1VlZwxKwo

To claim this, I am signing this object:

@joshnabbott
joshnabbott / restart-unicorn.rb
Created June 6, 2018 23:41 — forked from macks/restart-unicorn.rb
Graceful restart script for Unicorn
#!/usr/bin/ruby
# restart-unicorn: Graceful restart for Unicorn
# depends on Linux's proc(5)
#
# MIT License: Copyright(c)2011 MATSUYAMA Kengo
require 'scanf'
require 'timeout'
class ProcFS
@joshnabbott
joshnabbott / lua-resty-auto-ssl-perdomain.conf
Created May 30, 2018 03:07
openresty + lua-resty-auto-ssl config settings
#this file must be included in per domain settings (/etc/nginx/sites.available)
# Dynamic handler for issuing or returning certs for SNI domains.
ssl_certificate_by_lua_block {
auto_ssl:ssl_certificate()
}
ssl_certificate /etc/ssl/resty-auto-ssl-fallback.crt;
ssl_certificate_key /etc/ssl/resty-auto-ssl-fallback.key;
@joshnabbott
joshnabbott / .block
Created January 8, 2018 23:05
for reference: stacked area chart d3 v4
license: mit
@joshnabbott
joshnabbott / josh-flatten.rb
Created September 28, 2016 19:34
Method to flatten a multi-dimensional array written in Ruby
#!/usr/bin/env ruby
Array.class_eval {
def squarsh
return self if empty?
element = self.pop
if element.is_a?(Array)
self.squarsh + element.squarsh
else
@joshnabbott
joshnabbott / gist:c75d6e0c5b6bd695f3eb
Last active August 29, 2015 14:24
Taxspeaker TODO
- Hook up links in bottom Navigation - JOSH
- Update Copyright year in footer
- Find out what goes into "Tracks" nav
- Add /tracks section
DONE - "Search" isn't working - Josh
NOT NEEDED ATM - Integrate newsletter signup with Mailchimp
Topics
- Hook up delivery method selection
links
@joshnabbott
joshnabbott / gist:e7034adf0b07405e0ab9
Created November 7, 2014 16:53
/usr/local/Library/Formula/vim.rb
require "formula"
class Vim < Formula
homepage "http://www.vim.org/"
head "https://vim.googlecode.com/hg/"
# This package tracks debian-unstable: http://packages.debian.org/unstable/vim
url "http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.488.orig.tar.gz"
sha1 "6edad8cf9a08acb6a6e415b89bb13ccbd887d7c3"
# We only have special support for finding depends_on :python, but not yet for
56k: "https://123.campfirenow.com/images/56k.gif"
bell: ":bell:"
bezos: ":laughing::thought_balloon:"
bueller: "anyone?"
clowntown: "https://123.campfirenow.com/images/clowntown.gif"
cottoneyejoe: ":notes::hear_no_evil::notes:"
crickets: "hears crickets chirping"
dadgummit: "dad gummit!! :fishing_pole_and_fish:"
dangerzone: "https://123.campfirenow.com/images/dangerzone.png"
danielsan: ":fireworks: :trophy: :fireworks:"
@joshnabbott
joshnabbott / vim.rb
Created November 15, 2012 17:47
Homebrew vim formula that works on Lion
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :tag => 'v7-3-692'
version '7.3.692'
head 'https://vim.googlecode.com/hg/'