Skip to content

Instantly share code, notes, and snippets.

@strikeout
strikeout / Hasura Keycloak.md
Created June 20, 2020 11:04 — forked from webdeb/Hasura Keycloak.md
Basic Keycloak Script Mapper to provide Hasura claims

Steps to provide Hasura Claims in Keycloak generated JWT

  1. Create your realm / client
  2. Inside client configuration go to "Mappers"
  3. Click on "Create"
  4. Name it "hasura"
  5. Choose Mapper Type "Script Mapper"
  6. Add following script to demonstrate how it works
@strikeout
strikeout / README.md
Created August 10, 2019 14:50 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.
@strikeout
strikeout / BitMEX Jazz BEEP
Last active July 30, 2020 19:06
Aural indication of XBTUSD price movements via BitMEX websocket realtime-trade data. Uses the blues scale to add some funk to your trading. Copy & paste into your browser's console..
/**
* BitMEX JAZZ BEEP
*
* Aural indication of XBTUSD price movements via BitMEX websocket realtime-trade data.
* Uses the blues scale to add some funk to your trading.
*
*/
var options = {
@strikeout
strikeout / market.js
Created June 28, 2016 22:14 — forked from maxant/market.js
Files for creating a trading engine with Node.js.
// /////////////////////////////////////////////////
// this file contains all the classes related to a
// market.
// /////////////////////////////////////////////////
var log4js = require('log4js');
var logger = log4js.getLogger(require('path').basename(__filename, '.js'));
require('es6-collections');
var _ = require('underscore');
/**
@strikeout
strikeout / dmp.php
Created May 27, 2016 14:14
dmp.php
<?
/**
* Debug helper function. This is a wrapper for var_dump() that adds
* the <pre /> tags, cleans up newlines and indents, and runs
* htmlentities() before output.
*
* @param mixed $var The variable to dump.
* @param string $label OPTIONAL Label to prepend to output.
* @param bool $echo OPTIONAL Echo output if true.
* @return string
@strikeout
strikeout / addHostToMongoReplicaset.sh
Created October 8, 2015 10:20
Adds own host to a mongo replica-set. Runs on server-startup
#!/usr/bin/env bash
#get own hostname
ME=$(hostname);
# find replica-set master, we think its the first in the array
MASTER=`mongo --quiet --eval "cfg=rs.config(); print( cfg.members[0].host );"`
# connect to master, add ME
mongo --host $MASTER --eval "print( rs.add('"$ME"') );"
@strikeout
strikeout / sites-enabled__app.conf
Last active August 29, 2015 14:23
Nginx vhost config for Meteor with working websockets
server {
server_name thomassteinhauer.com;
location / {
root /var/www/app/bundle/;
}
location /admin {
root /var/www/admin/bundle/;
}
@strikeout
strikeout / gist:cfa3c6d009e85a0c78d0
Created February 26, 2015 17:09
Apache vhost config for Meteor with working websockets
<VirtualHost 10.248.206.19:80>
ServerName some.domain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list