Skip to content

Instantly share code, notes, and snippets.

View davisshaver's full-sized avatar

Davis Shaver davisshaver

View GitHub Profile
@davisshaver
davisshaver / autoload_nvm.sh
Created October 8, 2021 16:09
zsh nvm autoload
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
@davisshaver
davisshaver / class-jwt.php
Last active September 26, 2023 00:25
WordPress/Coral Project Talk JWT integration
<?php
use \Firebase\JWT\JWT as JWT_Wrapper;
/**
* Class wrapper for JWT tokens.
*/
class JWT {
use Singleton;
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=false
@davisshaver
davisshaver / keybase.md
Created January 12, 2018 12:02
keybase.md

Keybase proof

I hereby claim:

  • I am davisshaver on github.
  • I am davisshaver (https://keybase.io/davisshaver) on keybase.
  • I have a public key ASAAlv4MDb080OrGnXnbzNMe1LPCEFkdw9raHAhUAAwryAo

To claim this, I am signing this object:

const lighthouse = require('lighthouse');
const perfConfig = require('lighthouse/lighthouse-core/config/perf.json');
const chromeLauncher = require('lighthouse/chrome-launcher');
const debug = require('debug')('speed');
function launchChromeAndRunLighthouse(url, flags = {}, config = null) {
return chromeLauncher.launch().then(chrome => {
flags.chromeFlags = [
'--headless',
'--disable-gpu',
'--no-sandbox',
@davisshaver
davisshaver / functions.php
Last active September 2, 2017 10:29
Do not track mode for Twitter embeds – WordPress function
<?php
add_action( 'wp_head', function() {
echo '<meta name="twitter:dnt" content="on">';
});
@davisshaver
davisshaver / simplechart-shortcake.php
Created December 10, 2016 15:20
Basic plugin to add Shortcode UI for Simplechart
<?php
/*
Plugin Name: Simplechart/Shortcake UI Demo
Plugin URI: http://www.alleyinteractive.com/
Description: This plugin exists to demonstrate Simplechart with Shortcake UI
Version: 0.1
Author: Davis Shaver
Author URI: http://www.alleyinteractive.com/
*/
/* This program is free software; you can redistribute it and/or modify
@davisshaver
davisshaver / analyst.md
Last active July 8, 2016 01:21
Philadelphia Media Network Analytics Team Jobs – contact techjobs@philly.com

#Analyst To enhance the analytical capacity of all our business units, we are building a data and analytics resource within our information technology division. As analyst, you will report directly to our Director of Analytics and be part of a team that includes a Data Scientist and Engineer.

You will lead our analytical service – when a business unit has a question or hypothesis about their work, you will help them define the question and construct a methodology for answering and acting on the results.

Key Duties

  • Develop a workflow to provide analytical services to the company
  • Collaborate with stakeholders to understand and document goals or questions
  • Engage with technical resources to plan measurement or data collection strategy
@davisshaver
davisshaver / analyst.md
Last active December 1, 2016 05:53
Philadelphia Media Network Analytics Team - Interview Questions

Analyst Interview Questions

A collection of questions we typically ask job applicants during analyst interviews.

Scenario

The date is January 4. You are well rested after a festive holiday season. 🎉

We're gearing up to launch a new product, and we need your help.

Let's begin.

@davisshaver
davisshaver / phillyguntab.md
Last active March 23, 2016 11:26
Philly Gun Crisis Tabulator

TL;DR

We'd like to help Philadelphians understand the economic impact of gun violence, in hopes of raising awareness that this crisis affects us all. Tonight at 6pm meet us at Code for Philly hack night if you'd like to contribute to the build.

Localhost 908A N 3rd St, Philadelphia, PA at 6pm

##Theory (Mostly by Jim MacMillan, Max Marin contributed as well)