Skip to content

Instantly share code, notes, and snippets.

View bananatron's full-sized avatar
🍞
Stale bread is just lofi toast.

Spenser X bananatron

🍞
Stale bread is just lofi toast.
View GitHub Profile
@bananatron
bananatron / get_url_params.js
Last active March 20, 2017 19:08
Get URL Params
// Get URL PARAMS
var getUrlParam = function(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
@bananatron
bananatron / random_hex.js
Created April 26, 2017 01:12
Get Random Hex
'#'+Math.floor(Math.random()*16777215).toString(16);
“A history lesson for people who think that history doesn’t matter:
What’s the big deal about railroad tracks?
The US standard railroad gauge (distance between the rails) is 4 feet, 8.5 inches. That’s an exceedingly odd number.
Why was that gauge used?
Well, because that’s the way they built them in England, and English engineers designed the first US railroads.
Why did the English build them like that?
#!/bin/bash
# Logout current GitHub credentials and remove global user.name, user.email
echo -e "host=github.com\nprotocol=https\n" | git credential-osxkeychain erase
git config --unset-all --global user.name
git config --unset-all --global user.email
@bananatron
bananatron / fix-vs-code.txt
Created July 24, 2018 07:33
Change tab order to work sequencially in Visual Studio Code
- Preferences > Keyboard Shortcuts
- Override the 'Open Next Editor' and 'Open Previous Editor' commands, (you may have to unset previous bindings).
Why this default was changed blows my mind.
😎

Shortcuts

  • Ctrl + A Go to the beginning of the line you are currently typing on
  • Ctrl + E Go to the end of the line you are currently typing on
  • Ctrl + R Lets you search through previously used commands
  • Ctrl + W Delete the word before the cursor

Edit .profile || .bash_profile

@bananatron
bananatron / German_Cities.rb
Created September 18, 2018 13:01
List of German Cities as Array
[
"Aach",
"Aachen",
"Aalen",
"Aarbergen",
"Aasbüttel",
"Abenberg",
"Abensberg",
"Abentheuer",
"Absberg",
@bananatron
bananatron / german_zip_codes.csv
Created September 18, 2018 13:05
List of German Zip codes, w/ city & state
osm_id ort plz bundesland
1104550 Aach 78267 Baden-Württemberg
1255910 Aach 54298 Rheinland-Pfalz
62564 Aachen 52062 Nordrhein-Westfalen
62564 Aachen 52064 Nordrhein-Westfalen
62564 Aachen 52066 Nordrhein-Westfalen
62564 Aachen 52068 Nordrhein-Westfalen
62564 Aachen 52070 Nordrhein-Westfalen
62564 Aachen 52072 Nordrhein-Westfalen
62564 Aachen 52074 Nordrhein-Westfalen
@bananatron
bananatron / gist:928d6e696e2f72e65c4339b1997ecb9a
Created November 23, 2018 15:23
Start and Stop Postgres on OSX
pg_ctl -D /usr/local/var/postgres start
pg_ctl -D /usr/local/var/postgres stop
@bananatron
bananatron / gist:48724f19c52e49cfb042543463b1e6c1
Created December 31, 2018 13:51
too_much_and_for_too_long.txt
"Too much and for too long, we seemed to have surrendered personal excellence and community values in the mere accumulation of material things. Our Gross National Product, now, is over $800 billion dollars a year, but that Gross National Product - if we judge the United States of America by that - that Gross National Product counts air pollution and cigarette advertising, and ambulances to clear our highways of carnage. It counts special locks for our doors and the jails for the people who break them. It counts the destruction of the redwood and the loss of our natural wonder in chaotic sprawl. It counts napalm and counts nuclear warheads and armored cars for the police to fight the riots in our cities. It counts Whitman's rifle and Speck's knife, and the television programs which glorify violence in order to sell toys to our children. Yet the gross national product does not allow for the health of our children, the quality of their education or the joy of their play. It does not include the beauty of our poe