Skip to content

Instantly share code, notes, and snippets.

@freejoe76
freejoe76 / ny.md
Created April 17, 2018 20:11
State donations
  • Return a Gift to Wildlife
  • Missing and Exploited Children Fund
  • Breast Cancer Research and Education Fund
  • Prostate and Testicular Cancer Research and Education Fund
  • Alzheimer's Disease Fund
  • USOC/Lake Placid Olympic Training Center Fund
  • National September 11 Memorial
  • Volunteer Firefighting & EMS Fund
  • Teen Health Education Fund
  • Veterans Remembrance Fund
@freejoe76
freejoe76 / one-liner-js.md
Last active November 21, 2017 15:38
One-line javascript exercises

One-line javascript exercises

Each of these can be accomplished with one line of javascript.

  1. Create a variable and assign it the value explore (a string).
  2. Create a variable that's an array of two values (strings), red and blue.
  3. Create a variable that evaluates to the boolean true. Create another var, set it to 1. Compare the two (with javascript) and tell me whether javascript thinks they equal each other.
  4. Write a function named my_first_function that logs to console the word "hey". Name the function my_first_function. That line will start with function my_first....
  5. Edit that function so instead of logging to console, it "returns" the value "hey" ("return" is the name of the command you can use in a function that sends information back to whatever called the function). Call (run) the function and make sure it does what you think it does.
  6. Take your function from before and assign it to a variable named hey_maker. That line will start with var hey_maker.... Call it from the
@freejoe76
freejoe76 / regex-test-01.md
Last active May 16, 2017 19:23
Beginning Regular Expression tests

Neighborhoods part one

Given this markup, parse out the text of all neighborhoods, one neighborhood per line.

@freejoe76
freejoe76 / gist-collaboration.md
Last active June 21, 2018 14:49 — forked from maglietti/gistColaboration.md
How to collaborate on a gist

How to collaborate on a gist

  1. Clone your gist repo locally, i.e. git clone git@gist.github.com:f28d47c9ee46445b6a13a9c839c629e8.git gist-collaboration
  2. Add your friend’s fork as a remote e.g. if your friend is named Cindy: git remote add blergh https://gist.github.com/cindy/df03bdacaef75a80f310
  3. Fetch your friend’s commits: git fetch blergh
  4. Merge your friend’s changes into your repo: git merge blergh/master
  5. Push the changes back to GitHub: git push origin master
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 19 columns, instead of 10. in line 4.
INCIDENT_ID,OFFENSE_ID,OFFENSE_CODE,OFFENSE_CODE_EXTENSION,OFFENSE_TYPE_ID,OFFENSE_CATEGORY_ID,FIRST_OCCURRENCE_DATE,LAST_OCCURRENCE_DATE,REPORTED_DATE,INCIDENT_ADDRESS,GEO_X,GEO_Y,GEO_LON,GEO_LAT,DISTRICT_ID,PRECINCT_ID,NEIGHBORHOOD_ID,IS_CRIME,IS_TRAFFIC
201760368.0,201760368480300,4803,0,police-false-information,all-other-crimes,2017-01-27 19:11:00,,2017-01-27 21:00:00,1O BLOCK S CHEROKEE ST,3142836.0,1686137.0,-104.9922584,39.7161524,3,311,baker,1,0
2017249049.0,2017249049540100,5401,0,traffic-accident-hit-and-run,traffic-accident,2017-04-17 10:20:00,,2017-04-17 10:22:00,11O BLOCK E 14TH AVE,3144334.0,1694288.0,-104.9867698,39.7385053,6,623,capitol-hill,0,1
2017239325.0,2017239325240400,2404,0,theft-of-motor-vehicle,auto-theft,2017-04-12 17:00:00,,2017-04-13 07:52:00,111O BLOCK N BANNOCK ST,3143206.0,1687128.0,-104.9909234,39.7188672,3,311,baker,1,0
2016593001.0,2016593001230400,2304,0,theft-parts-from-vehicle,theft-from-motor-vehicle,2016-09-13 17:00:00,2016-09-15 15:00:00,2016-09-15 16:30:00,1O S UTICA
@freejoe76
freejoe76 / _PYTHON-BOILERPLATE-README.md
Last active June 2, 2021 02:52
My python boilerplate

These files, as written, are aimed at command-line execution, but because if __name__ == '__main__': only fires when run on the command line, it can also be included in another python script if need be.

It uses doctests (which fire when run from the command line with a -t / --test flag) because I like doctests because they're the simplest way to add tests to your code, and tests in your code are a good way to help remind future-you how current-you imagined you'd be using the code you wrote.

The code you want to execute goes in the main() method.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@freejoe76
freejoe76 / desktop-only-iframe.html
Created October 26, 2016 20:22
Desktop-only include
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title></title>
<script>
var is_mobile = function() {
var check = false;
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|
@freejoe76
freejoe76 / by-team.csv
Last active October 13, 2015 17:02
MLB contested plays, 2015
Team Total Challenges Confirmed Stands Overturned
Arizona 36 3 10 23
Atlanta 46 10 13 23
Baltimore 30 9 4 17
Boston 51 18 13 20
Chicago (AL) 41 5 15 21
Chicago (NL) 50 11 11 28
Cincinnati 33 4 9 20
Cleveland 28 3 10 15
Colorado 47 11 12 24
@freejoe76
freejoe76 / ums_2015.csv
Last active August 29, 2015 14:25
Bands I want to see at UMS 2015
artist day time venue url
Leggy Thursday 8 p.m. Hi-Dive https://leggy.bandcamp.com/
Baby Birds Don't Drink Milk Thursday 10 p.m. Hi-Dive https://soundcloud.com/bbddm
Ambit Thursday 11 p.m. Blue Ice Lounge https://soundcloud.com/greetingsfromambit
Bear Antler Thursday 11 p.m. Illegal Pete's http://www.bearantler.com/
LSD Bags Friday 9 p.m. Irish Rover http://lsdbags.bandcamp.com/
Cop Circles Saturday 10 p.m. Brendan's Pub http://copcircles.bandcamp.com/
Panther Martin Sunday 5 p.m. Irish Rover https://soundcloud.com/panther-martin
Turner Jackson Sunday 10 p.m. Blue Ice Lounge https://soundcloud.com/turnerjacksonmusic
High Five Sunday 11 p.m. Blue Ice Lounge https://soundcloud.com/highfivehiphop