Skip to content

Instantly share code, notes, and snippets.


Michael Russell subhaze

View GitHub Profile
subhaze /
Last active Jun 9, 2019
Bash script to install/update apps on crositini
# source:
# curl -s | bash -
get_go() {
# [](
# Download latest Golang release for AMD64
set -euf -o pipefail
# Install pre-reqs
subhaze / index.js
Last active Nov 29, 2018
Azure function to update IP on Cloudflare DNS; Usefull for DSM DDNS updates.
View index.js
// URL set in Synology would look something like this:
// https://<YOUR_SUB_DOMAIN><YOUR_CF_EMAIL_LOGIN>&dnsidentifier=<YOUR_DNS_ID_FROM_CF>&recordtype=A
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
var http = require('https');
var hostname = req.query.hostname;
var ip = req.query.ip;
var zoneid = req.query.zoneid;
subhaze / deploy.cmd
Created Jan 12, 2018 — forked from benmccallum/deploy.cmd
Purge an Azure CDN cache with cURL, jq and deploy.cmd batch file
View deploy.cmd
:: Below is an example of extending a deploy.cmd file (see kudu custom deployment scripts) to clear an Azure CDN endpoint
:: using the Azure Resource Manager (ARM) API with help of cURL.exe and jq.exe utils.
:: 4. Purge CDN cache of all caches files
:: Requires an application to be setup in the Azure Active Directory on the same tenant,
:: with a client id and key/secret, and permissions to the Azure CDN Endpoint (CDN Endpoint Contributor)
::SET CLIENT_ID="from-app-settings"
::SET CLIENT_SECRET="from-app-settings"
echo 4. Skipping Azure CDN cache purge. App Setting "CLIENT_ID" was not found. Potentially this is a local test deployment run.
subhaze / queryParams.js
Last active Sep 5, 2017
Parse Query Params
View queryParams.js
export const queryParams = (locationSearch = =>
(acc, curr) =>
acc, curr
.reduce((acc, curr) => ({ [acc]: _decodeURIComponent(curr) })),
View JavaScript TS.sublime-syntax
name: JavaScript TS
- js
scope: source.ts
- match: ""
push: "Packages/JavaScript/JavaScript.sublime-syntax"
subhaze /
Created Apr 29, 2016
ES2015 Build with npm/CodeKit
browserify src/main.js -t babelify > dist/main.js
osascript -e 'display notification "npm run build completed" with title "CodeKit Hook"'
subhaze / index.html
Last active Apr 19, 2016
pipeline [Array#reduce]
View index.html
<pre style="padding: 20px"><code class="hljs js">
function pipeline(data, ...fns){
return fns.reduce((acc, curr) => curr(acc), data);
let abc = pipeline('a', (v)=>v+'b', (v)=>v+'c');
// "abc"
View RxJS Sequence Memory.markdown