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
/* | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
* MIT license | |
* | |
* Includes enhancements by Scott Trenda <scott.trenda.net> | |
* and Kris Kowal <cixar.com/~kris.kowal/> | |
* | |
* Accepts a date, a mask, or a date and a mask. | |
* Returns a formatted version of the given date. |
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
# Stop all containers | |
docker stop $(docker ps -q) | |
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Remove all images | |
docker rmi $(docker images -aq) | |
# See logs of a container |
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
// Adapted from the Axios HTTP library | |
// https://github.com/axios/axios/blob/76f09afc03fbcf392d31ce88448246bcd4f91f8c/lib/defaults.js#L29 | |
/** | |
* Trim excess whitespace off the beginning and end of a string | |
* | |
* @param {String} str The String to trim | |
* @returns {String} The String freed of excess whitespace | |
*/ | |
const trim = (str) => { |
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
javascript:let video=document.getElementsByTagName('video')[0];video.removeAttribute('disablePictureInPicture');video.requestPictureInPicture() |
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
process.stdout.write('hello world') |
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
// Pipe takes the first argument and pipes it though each of the functions that you provide as the remaining arguments, | |
// and can be implemented as follows: | |
const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x); | |
const fn1 = s => s.toLowerCase(); | |
const fn2 = s => s.split('').reverse().join(''); | |
const fn3 = s => s + '!' | |
const newFunc = pipe(fn1, fn2, fn3); | |
const result = newFunc('Time'); // emit! |
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
## This script covers | |
# * Running Docker containers on a host. | |
# * Storing Docker images in the Google Container Repository (GCR). | |
# * Deploying GCR images on Kubernetes. | |
# * Pushing updates onto Kubernetes. | |
# * Automating deployments to Kubernetes using Jenkins. | |
GCP_PROJECT_ID="qwiklabs-gcp-04-17810074a304" | |
# Clone a repository from the Google Cloud Shell |
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
<p>Hello | |
<script> | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', '/stream'); | |
xhr.seenBytes = 0; | |
xhr.onreadystatechange = function() { | |
console.log("state change.. state: "+ xhr.readyState); |
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
## General commands | |
# Get active account name | |
gcloud auth list | |
# List the project ID | |
gcloud config list project | |
# Find default zone | |
gcloud compute project-info describe --project <GCP Project ID> |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"Service": [ | |
"lambda.amazonaws.com", | |
"edgelambda.amazonaws.com" | |
] |