Skip to content

Instantly share code, notes, and snippets.

View jackkoppa's full-sized avatar
👋

Jack Koppa jackkoppa

👋
View GitHub Profile
console.log('Hello world for no reason')
{
"info": {
"_postman_id": "240bf058-ff96-4ed4-a5a5-3d99c291ae30",
"name": "Compass: API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "APIV3",
"item": [
// Something fun to try:
- in App.vue, and `sections` to data
- an array of the 5 component names
- in NavBar.vue, accept a `sections` prop, instead of hardcoding the sections in NavBar
- in App.vue, instead of listing the 5 components in your template:
- you can do:
<component v-for="section in sections" :key="section" :is="section" />
methods: {
@jackkoppa
jackkoppa / falsy_values_property_access.js
Created October 2, 2018 12:46
Checking why null & undefined are the "right" falsy values to exclude during existence checks in JavaScript
console.log(
'why `if (someVar != null)` will prevent type errors when we want to follow up with a check for a property \n',
`truthy value: ${'a string'.hasOwnProperty('test')}\n`, // executes
`empty string: ${''.hasOwnProperty('test')}\n`, // executes
`0: ${0['hasOwnProperty']('test')}\n`, // executes
`false: ${false.hasOwnProperty('test')}\n`, // executes
`NaN: ${NaN.hasOwnProperty('test')}\n` // executes
)
setTimeout(() => console.log(`null: ${null.hasOwnProperty('test')}\n` /* Type Error */ ), 500)
setTimeout(() => console.log(`undefined: ${undefined.hasOwnProperty('test')}\n` /* Type Error */ ), 1000)
@jackkoppa
jackkoppa / fix-sw.js
Last active August 10, 2023 20:40
Workaround npm build script, to temporarily fix Angular #21636 (see https://github.com/angular/angular/issues/21636#issuecomment-366205459)
/*
*
* Temporary fix for https://github.com/angular/angular/issues/21636
*
* Include in your project; run after the `ng build --prod` step by running `node location/of/this/script/fix-sw`
*
* Warning: removes any instances of setting EXISTING_CLIENTS_ONLY state, which will likely have adverse effects in some situations
*
*/
{
"theaters": [
{
"id": 3598,
"tribuneTheaterId": 4848,
"providerTheaterId": "",
"name": "Century 16 Greenback Lane",
"address": "6233 Garfield Ave.- At former site of Cinedome 9",
"city": "Sacramento",
"state": "CA",
@jackkoppa
jackkoppa / format_peaks_trip_sheets.vba
Created February 17, 2017 21:58
For downloaded trip spreadsheets for Peaks and Professors, formats & copies each sheet, allowing easy import into Google Sheets
Sub PeaksTripPrep()
'
' PeaksTripPrep Macro
'
' Keyboard Shortcut: Ctrl+p
'
Dim rngName As Range
Dim rngDate As Range
Dim rngHowMany As Range
Dim rngPayment As Range
@jackkoppa
jackkoppa / openevents.user.js
Created March 14, 2016 03:31
Open EventSpot Events by Keyword
// ==UserScript==
// @name Open EventSpot Events by Keyword
// @namespace http://jackkoppa.com
// @version 0.1.1
// @description From the main page of EventSpot, open all events that match a user-given keyword (in this case, Professor's last name)
// @author jackkoppa
// @match https://ui.constantcontact.com/rnavmap/evp/manage
// @grant none
// ==/UserScript==
/* jshint -W097 */
@jackkoppa
jackkoppa / downloadreport.user.js
Created March 14, 2016 03:30
Auto-Download Participant Report from EventSpot
// ==UserScript==
// @name Auto-Download Participant Report from EventSpot
// @namespace http://jackkoppa.com/
// @version 0.1.1
// @description On any Event page, opens the reporting tab, runs a full report, waits for it to export, and downloads the report.
// @author jackkoppa
// @match https://ui.constantcontact.com/rnavmap/evp/hub/*
// @grant none
// ==/UserScript==
/* jshint -W097 */