Skip to content

Instantly share code, notes, and snippets.

Luke Griffiths Sporky023

  • Cambridge, MA
Block or report user

Report or block Sporky023

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Sporky023 /
Last active Nov 26, 2018 — forked from bastman/
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
Sporky023 /
Created Jan 2, 2017
bash / PS1 / display two levels of pwd context
# thanks:
function PWD {
pwd | sed 's/^\/Users\/<YOUR_USERNAME>/~/' | awk -F\/ '{print $(NF-1),$(NF)}' | sed 's/ /\//' | sed 's/~\/~/~/'
export PS1="\u\[\e[m\]:\[\e[36m\]\$(PWD)\[\e[m\] "
# backslash before $ tells it to run the function each time;
# else it is only run once and won't update as you switch directories

in your form.html.haml

  $(document).on('click', '.add_an_aol_field', function(){
    $aol_field = $('#aol_selector_template').html();

Sporky023 / gist:9ce9cf0767277104d77a
Created Dec 16, 2014
vimrc leader mappings for CtrlP
View gist:9ce9cf0767277104d77a
nmap <Leader>ae :CtrlP<CR>
nmap <Leader>av :vs<CR>:CtrlP<CR>
nmap <Leader>as :sp<CR>:CtrlP<CR>
nmap <Leader>at :tabe<CR>:CtrlP<CR>
View gist:1e02f68941545ee93858

how to deploy to heroku

step 1: create a local copy (assumes you have git installed)

option A: get the code from github

visit in browser
on right side of page, click to save the "clone url"

git clone [paste clone url]

View gist:4195529
"find potential suppliers for the pen thing"
* background:
* I want to sell the following product:
* a gag pen that cannot write
* both ends are the "inactive" end of the pen
* see these drawings:
* Based on the simplicity of my design, I believe that any place which currently manufactures pens should be able to manufacture this, using existing parts on hand. However, I haven't had any luck with so far. I've gotten 3 quotes through, but they are very bad quality. I may want to contact these manufacturers more directly.
Sporky023 / gist:3746265
Created Sep 18, 2012
View gist:3746265
Log in as admin
click "Admin"
click "Create New Company"
fill in company form
click "Save and add location"
fill in location form
click "Save and add another location"
fill in location form
click "Save and add an employee"
fill in employee form
View openbay_state_transitions.txt
Non-indented lines show actions take by users.
Indented lines show resulting states of various records.
Everything is from SP's point of view:
[P, C, or S] (P)ending, (C)losed, (S)ettled. Which list to show Offer on under "Manage Offers"
[A, C] (A)ctive, (C)losed. Which list to show Service Request on.
SCENARIO 1: VO withdraws offer
VO: create service_request_1
service_request_1: 'Active, N days remaining' - A
Sporky023 / gist:3611463
Created Sep 3, 2012
traceroute to PT assets
View gist:3611463
~ $ traceroute
traceroute: Warning: has multiple addresses; using
traceroute to (, 64 hops max, 52 byte packets
1 ( 1.155 ms 0.616 ms 0.849 ms
2 ( 1.350 ms 0.918 ms 0.883 ms
3 ( 3.757 ms 3.509 ms 4.271 ms
4 ( 3.121 ms 5.876 ms 3.666 ms
5 ( 11.355 ms 18.006 ms 10.235 ms
6 ( 7.679 ms 7.572 ms 10.289 ms
7 ( 7.741 ms 7.456 ms 7.547 ms
View gist:3229744
We're changing the offer form a bit to have a new set of fields for each line item in the offer. Therefore we need to change the set of columns in the database table that stores these line items. Old data will need to be modified to fit the new format. This document outlines an algorithm for modifying the old data into the new format.
* description
* quantity
* part_price (unit price per part)
You can’t perform that action at this time.