Skip to content

Instantly share code, notes, and snippets.

@spham
spham / postman-pre-request.js
Created November 3, 2018 16:42 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@spham
spham / gist:27115b72bdd1c8036c7966c78cb9fabf
Created December 15, 2018 20:43 — forked from psiborg/gist:1569706
HTML Base64 favicon (RIM)
<link href="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
# Git aliases
alias gs="git status"
alias ga="git add"
alias gaa="git add ."
alias gc="git commit"
alias gp="git push"
alias gpl="git pull"
alias gcm="git commit -m"
alias gl="git log"
- https://github.com/spham/zuix-html-pwa
@spham
spham / 02-sa.sh
Created May 30, 2019 11:59 — forked from vfarcic/02-sa.sh
cd k8s-specs
# Only if minishift
oc apply -f sa/jenkins-no-sa-oc.yml --record
# Only if NOT minishift
kubectl apply \
-f sa/jenkins-no-sa.yml \
--record
######################
# Create The Cluster #
######################
# Make sure that your minishift version is v1.15 or higher
minishift start \
--vm-driver virtualbox \
--cpus 2 \
--memory 2048 \
@spham
spham / api_cache.php
Created June 6, 2019 03:35 — forked from corbanb/api_cache.php
Simple API caching with PHP
<?php
/**
* API Request Caching
*
* Use server-side caching to store API request's as JSON at a set
* interval, rather than each pageload.
*
* @arg Argument description and usage info
*/
@spham
spham / guitar-tuner.js
Created June 27, 2019 03:21 — forked from muttoni/guitar-tuner.js
The lambda code to the Guitar Tuner skill we are building
/* This code has been generated from your interaction model
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
// There are three sections, Text Strings, Skill Code, and Helper Function(s).
// You can copy and paste the contents as the code for a new Lambda function, using the alexa-skill-kit-sdk-factskill template.
// This code includes helper functions for compatibility with versions of the SDK prior to 1.0.9, which includes the dialog directives.
@spham
spham / noupdate.sh
Created September 9, 2019 03:58
disable notification mac os x
#!/bin/bash
# Disable macOS Upgrade notifications
# Step 1: prevent the update which brings the notification down
softwareupdate --ignore macOSInstallerNotification_GM
echo
# Step 2: delete the file if it's already on the computer