Skip to content

Instantly share code, notes, and snippets.

@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

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.

https://www.genomicsplc.com

@Aracturat
Aracturat / functionToSQL.ts
Last active November 8, 2017 14:53
Function To SQL
import * as ts from 'typescript';
class Test {
public ParamString: string;
public ParamInt: number;
public ParamString2: string;
}
class Collection<T> {
@lobrien
lobrien / led_segs.py
Last active July 15, 2024 19:48
Keras neural net that recognizes number in a 7-segment display
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
{
"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": [
@michaelvillar
michaelvillar / .zshrc
Created August 25, 2016 00:19
Get a OS X Notification when a slow CLI command finishes
# 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]* *//')"
@marshallswain
marshallswain / feathersjs-auth0.js
Created June 4, 2016 20:49 — forked from theevangelista/feathersjs-auth0.js
A hook to populate an user from Auth0 into feathersjs
const request = require('request-promise');
const errors = require('feathers-errors');
const options = {
idField: 'sub',
issuer: 'iss'
};
module.exports = function() {
@mhausenblas
mhausenblas / cockroach-sql-dml-query.sh
Created May 24, 2016 09:31
CockroachDB: create table, insert data and query it
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.
maxroach@10.0.7.99:12504> SET DATABASE = bank;
maxroach@10.0.7.99:12504> CREATE TABLE accounts (id INT PRIMARY KEY, balance INT);
maxroach@10.0.7.99:12504> INSERT INTO accounts (id, balance) VALUES (1, 1000), (2, 250);
INSERT 2
maxroach@10.0.7.99:12504> INSERT INTO accounts (id, balance) VALUES (3, 10), (4, 670);
INSERT 2
@mhausenblas
mhausenblas / cockroach-sql-init.sh
Created May 24, 2016 09:29
CockroachDB: set up database and user using the internal SQL client
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.
root@10.0.7.99:12504> CREATE DATABASE bank;
CREATE DATABASE
root@10.0.7.99:12504> show databases;
+----------+
| Database |
+----------+
@mhausenblas
mhausenblas / cockroach.json
Created May 24, 2016 09:21
A Marathon app spec to launch CockroachDB (dev/test mode)
{
"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",
@mhausenblas
mhausenblas / azure-public-node.md
Last active December 15, 2016 13:29
How to expose apps on DC/OS public node on Azure