Coding style https://www.python.org/dev/peps/pep-0008/
.gitignore https://github.com/Microsoft/vscode-python/blob/master/.gitignore
function deconstruct(number){ | |
let sign = 1; | |
let coefficient = number; | |
let exponent = 0; | |
// Remove sign from the coefficient | |
if(coefficient < 0){ | |
coefficient = -coefficient; | |
sign = -1; | |
} |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
namespace SimpleWebSockets | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var host = new WebHostBuilder() |
function stringFormat(format, args) { | |
if (arguments.length === 0) { | |
throw "Missing arguments"; | |
} | |
if (!args) { | |
return format; | |
} | |
return format.replace(/{(\d+)}/g, function(match, number) { |
atm.loadScript = (function () { | |
let loadedScripts = []; | |
return function (src, callback) { | |
if (~loadedScripts.indexOf(src) && callback) { | |
callback(); | |
} | |
$.ajax({ | |
url: src, |
Source: https://www.washington.edu/imap/documentation/commndmt.txt.html | |
/* ======================================================================== | |
* Copyright 1988-2006 University of Washington | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
powershell -executionpolicy bypass -File .\script.ps1 |
# https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#without-kubectl-proxy | |
# Check all possible clusters, as you .KUBECONFIG may have multiple contexts: | |
kubectl config view -o jsonpath='{"Cluster name\tServer\n"}{range .clusters[*]}{.name}{"\t"}{.cluster.server}{"\n"}{end}' | |
# Select name of cluster you want to interact with from above output: | |
export CLUSTER_NAME="some_server_name" | |
# Point to the API server refering the cluster name | |
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}") |
console.log('Press any key to exit'); | |
process.stdin.setRawMode(true); | |
process.stdin.resume(); | |
process.stdin.on('data', process.exit.bind(process, 0)); |
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function #20190526_1018 | |
var timestamp = () => (new Date().getSeconds() + ' ' + new Date().getMilliseconds()); | |
var resolveAfter2Seconds = function() { | |
console.log("starting slow promise " + timestamp()); | |
return new Promise(resolve => { | |
setTimeout(function() { | |
resolve("slow " + timestamp()); | |
console.log("slow promise is done " + timestamp()); | |
}, 5000); |