Skip to content

Instantly share code, notes, and snippets.

View jphenow's full-sized avatar
💻
👋🏻 :octocat:

Jon Phenow jphenow

💻
👋🏻 :octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jphenow on github.
  • I am jphenow (https://keybase.io/jphenow) on keybase.
  • I have a public key ASDK6Z0QVCc08S2Lyl-7s7wfn3B7v7HAfNlaV9eiH7HiyQo

To claim this, I am signing this object:

#!/usr/bin/env bash
set -e
# Set to your project name
project="Highrise.VisualStudio.Plugin"
assetPath="$project/bin/Release/net461"
targetReleaseDir="./release"
# Find mpack asset from bin dir and make sure it's the latest one
@jphenow
jphenow / scrape
Created January 26, 2017 22:28
Scrape Slack html for a team's emojis, download them and rename them so you can use elsewhere
#!/usr/bin/env ruby
# Go to emoji customization page on your Slack org
# download the html for that page
# Also need "nokogiri" installed
#
# Usage: scrape <htmlfile>
require 'nokogiri'
require 'open-uri'
file = ARGV[0]
@jphenow
jphenow / circle.yml
Last active June 14, 2016 17:08
9.5 became the Postgres Default on Circle CI
# ...
dependencies:
override:
# Delete these two lines
- sudo service postgresql stop 9.4
- sudo cp -v /etc/postgresql/9.{4,5}/main/pg_hba.conf && sudo service postgresql restart 9.5
# ...
database:
override:
# Delete lines like these below. Yours won't be the same, but we had to do something
@jphenow
jphenow / .bashrc
Created March 9, 2016 18:01
Run all go tests in a project without running through vendor dir
# ...
gta() {
base=$(echo $PWD | sed "s|$GOPATH/src/||")
go test $(go list ./... | grep -v vendor | sed "s|$base/|./|")
}
@jphenow
jphenow / tmux.conf
Created February 9, 2016 18:04
a tmux conf that works with new keybindings blah blah
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling

Keybase proof

I hereby claim:

  • I am jphenow on github.
  • I am jphenow (https://keybase.io/jphenow) on keybase.
  • I have a public key whose fingerprint is 164C 1F18 D294 471E C623 E14B 221C D2C7 BCA3 53FC

To claim this, I am signing this object:

@jphenow
jphenow / wait-for-return-loop.js
Created October 12, 2015 18:44
Wait for callback to loop
var queue = [] // build up what you'd be looping through
function callAjax(el) {
$.ajax(things, {
complete: function() {
callAjax(queue.shift)
}
})
}
@jphenow
jphenow / decoration.rb
Created November 19, 2014 17:09
Specific Purpose Model Decoration
class ResourcePurchase::ResourceDecorators::Base < SimpleDelegator
def anew
end
def renew
end
end
# You could write a router if you want to make this follow
# something of a Factory pattern or do something like
@jphenow
jphenow / uuid.rb
Created October 9, 2014 19:37
uuid
# make IdExtractor partition the list sent in so you can get ids and uuids
scope :id_or_uuid, ->(id_or_uuid) {
extracted = IdExtractor.extract(id_or_uuid)
where(["#{table_name}.id IN (?) OR #{table_name}.uuid IN (?)", extracted.ids, extracted.uuids])
}