Skip to content

Instantly share code, notes, and snippets.

@freejoe76
freejoe76 / dev-setup.md
Last active October 24, 2018 20:31
What I did when I got a new mac laptop

What I did when I got a new mac laptop

August 2018

Install stuff

Install these programs

  • iTerm2
  • Firefox
    • Plugin: WebDeveloper
  • Opera
@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
@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 / searchall.bash
Last active October 25, 2017 21:48
Search all files matching a pattern for a particular string
#!/bin/bash
# For the times when grep -r just doesn't cut it: Search all files matching a pattern for a particular string
# Example command (best when put in a folder that's on your path somewhere):
# searchall.bash -f *.php -s 'hoops'
# What arguments do we pass?
while [ "$1" != "" ]; do
case $1 in
-f | --file ) shift
file=$1
@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.

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
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)|
<!-- ################################################################################################ -->
<!-- -->
<!-- THIS FILE IS FAR FROM COMPLETE -- DON'T USE IT WITHOUT FIXING EVERYTHING!! -->
<!-- -->
<!-- Things to fix: -->
<!-- Everything in the meta twitter: tags! -->
<!-- Everything in the Facebook og: meta tags -->
<!-- All the other meta tags! -->
<!-- The Title! -->
<!-- The Omniture tags!