Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
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
import * as ts from 'typescript'; | |
class Test { | |
public ParamString: string; | |
public ParamInt: number; | |
public ParamString2: string; | |
} | |
class Collection<T> { |
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
import numpy as np | |
from keras.models import Sequential | |
from keras.layers.core import Activation, Dense | |
from keras.optimizers import SGD | |
# Trains a neural net that recognizes the digit displayed by a 7-segment LED: | |
# "Lit segments" are indexed as: | |
# -- 0 -- | |
# | | | |
# 1 2 |
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
{ | |
"id": "/alluxio-master", | |
"cmd": "/alluxio/bin/alluxio bootstrapConf localhost s3\n/start.sh master", | |
"cpus": 1, | |
"mem": 512, | |
"disk": 100, | |
"instances": 1, | |
"container": { | |
"type": "DOCKER", | |
"volumes": [ |
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
# Based on http://frantic.im/notify-on-completion and https://gist.github.com/jamesmacaulay/860763 | |
# Notify on completion | |
function f_notifyme { | |
LAST_EXIT_CODE=$? | |
CMD=$(fc -ln -1) | |
terminal-notifier -title "$CMD" -message "Status code: $LAST_EXIT_CODE" & | |
} | |
save_preexec_time() { | |
export PREEXEC_CMD="$(history | tail -1 | sed 's/ *[0-9]* *//')" |
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
const request = require('request-promise'); | |
const errors = require('feathers-errors'); | |
const options = { | |
idField: 'sub', | |
issuer: 'iss' | |
}; | |
module.exports = function() { |
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
core@ip-10-0-7-99 ~ $ docker run -it cockroachdb/cockroach:beta-20160512 sql --host=10.0.7.99 --port=12504 --user=maxroach | |
# Welcome to the cockroach SQL interface. | |
# All statements must be terminated by a semicolon. | |
# To exit: CTRL + D. | |
[email protected]:12504> SET DATABASE = bank; | |
[email protected]:12504> CREATE TABLE accounts (id INT PRIMARY KEY, balance INT); | |
[email protected]:12504> INSERT INTO accounts (id, balance) VALUES (1, 1000), (2, 250); | |
INSERT 2 | |
[email protected]:12504> INSERT INTO accounts (id, balance) VALUES (3, 10), (4, 670); | |
INSERT 2 |
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
core@ip-10-0-7-99 ~ $ docker run -it cockroachdb/cockroach:beta-20160512 sql --host=10.0.7.99 --port=12504 | |
# Welcome to the cockroach SQL interface. | |
# All statements must be terminated by a semicolon. | |
# To exit: CTRL + D. | |
[email protected]:12504> CREATE DATABASE bank; | |
CREATE DATABASE | |
[email protected]:12504> show databases; | |
+----------+ | |
| Database | | |
+----------+ |
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
{ | |
"id": "cockroachdb", | |
"instances": 1, | |
"cpus": 1, | |
"mem": 300, | |
"cmd": "./cockroach start --insecure --host=0.0.0.0 --logtostderr", | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "cockroachdb/cockroach:beta-20160512", |
- Go to the public agent and add a
Inbound security rule
in the network security group tab with*
(or port range) - Go to the load balancer and add a
Health probe
rule per app/service - Also add a load balancing rule (using above probe) per app/service
See https://docs.microsoft.com/en-us/azure/container-service/container-service-enable-public-access
NewerOlder