Skip to content

Instantly share code, notes, and snippets.

View subhaze's full-sized avatar

Michael Russell subhaze

View GitHub Profile
subhaze /
Last active June 9, 2019 17:28
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 November 29, 2018 15:08
Azure function to update IP on Cloudflare DNS; Usefull for DSM DDNS updates.
// 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 January 12, 2018 17:12 — forked from benmccallum/deploy.cmd
Purge an Azure CDN cache with cURL, jq and deploy.cmd batch file
:: 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 September 5, 2017 19:56
Parse Query Params
export const queryParams = (locationSearch = =>
(acc, curr) =>
acc, curr
.reduce((acc, curr) => ({ [acc]: _decodeURIComponent(curr) })),
name: JavaScript TS
- js
scope: source.ts
- match: ""
push: "Packages/JavaScript/JavaScript.sublime-syntax"
subhaze /
Created April 29, 2016 20:16
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 / flatMap [Array#reduce].markdown
Created April 22, 2016 14:25
flatMap [Array#reduce]
subhaze / index.html
Last active April 19, 2016 23:57
pipeline [Array#reduce]
<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"
subhaze / concatAll [Array#reduce].markdown
Last active April 19, 2016 22:36
concatAll [Array#reduce]
subhaze / RxJS Sequence Memory.markdown
Last active April 18, 2016 00:07
RxJS Sequence Memory