Skip to content

Instantly share code, notes, and snippets.

@strikeout
strikeout / Hasura Keycloak.md
Created Jun 20, 2020 — forked from webdeb/Hasura Keycloak.md
Basic Keycloak Script Mapper to provide Hasura claims
View Hasura Keycloak.md

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 Aug 10, 2019 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.
View README.md
@strikeout
strikeout / BitMEX Jazz BEEP
Last active Jun 24, 2019
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..
View BitMEX Jazz BEEP
/**
* 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 Jun 28, 2016 — forked from maxant/market.js
Files for creating a trading engine with Node.js.
View market.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');
/**
View 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 Oct 8, 2015
Adds own host to a mongo replica-set. Runs on server-startup
View addHostToMongoReplicaset.sh
#!/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 Aug 29, 2015
Nginx vhost config for Meteor with working websockets
View sites-enabled__app.conf
server {
server_name thomassteinhauer.com;
location / {
root /var/www/app/bundle/;
}
location /admin {
root /var/www/admin/bundle/;
}
@strikeout
strikeout / gist:cfa3c6d009e85a0c78d0
Created Feb 26, 2015
Apache vhost config for Meteor with working websockets
View gist:cfa3c6d009e85a0c78d0
<VirtualHost 10.248.206.19:80>
ServerName some.domain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
View Price-Time Matching Engine.c
/*****************************************************************************
* 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
View Price-Time Matching Engine.c
/*****************************************************************************
* 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
You can’t perform that action at this time.