A Pen by Michael Russell on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://www.reddit.com/r/Crostini/wiki/howto/vscode-docker-golang-example | |
# curl -s https://gist.githubusercontent.com/subhaze/75a38ede0fb4b32ac41a87e242ce0cde/raw/8bb0cde6e5cf7727f90615a16b3d6e6cdb51a940/setup_crostini.sh | bash - | |
get_go() { | |
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69) | |
# Download latest Golang release for AMD64 | |
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz | |
set -euf -o pipefail | |
# Install pre-reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// URL set in Synology would look something like this: | |
// https://<YOUR_SUB_DOMAIN>.azurewebsites.net/api/HttpTriggerJS1?hostname=__HOSTNAME__&ip=__MYIP__&zoneid=__USERNAME__&key=__PASSWORD__&email=<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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: 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" | |
IF NOT DEFINED CLIENT_ID ( | |
echo 4. Skipping Azure CDN cache purge. App Setting "CLIENT_ID" was not found. Potentially this is a local test deployment run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const queryParams = (locationSearch = window.location.search) => | |
locationSearch | |
.substr(1) | |
.split('&') | |
.reduce( | |
(acc, curr) => | |
Object.assign( | |
acc, curr | |
.split('=') | |
.reduce((acc, curr) => ({ [acc]: _decodeURIComponent(curr) })), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML1.2 | |
--- | |
name: JavaScript TS | |
file_extensions: | |
- js | |
scope: source.ts | |
contexts: | |
main: | |
- match: "" | |
push: "Packages/JavaScript/JavaScript.sublime-syntax" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
browserify src/main.js -t babelify > dist/main.js | |
osascript -e 'display notification "npm run build completed" with title "CodeKit Hook"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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'); | |
console.log(abc); | |
// "abc" |
A Pen by Michael Russell on CodePen.
Just toying around with RxJS stuff.
A Pen by Michael Russell on CodePen.
NewerOlder