Skip to content

Instantly share code, notes, and snippets.

View kessler's full-sized avatar
:octocat:
Be well!

Yaniv Kessler kessler

:octocat:
Be well!
View GitHub Profile
@jdrew1303
jdrew1303 / readme.md
Last active October 21, 2024 07:48
Market Order Matching Engine

Introduction

The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o

@MauricioMoraes
MauricioMoraes / access_postgresql_with_docker.md
Last active August 30, 2024 05:21
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@chrisveness
chrisveness / crypto-aes-gcm.js
Last active October 5, 2024 16:59
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active August 8, 2024 11:53
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@guycalledseven
guycalledseven / osx_yosemite_disable_features.sh
Last active August 16, 2021 01:57
Disabling OSX Yosemite annoyances / features I have no use of
# Tested on OSX Yosemite 10.10.4
# there is also an updated version (work in progress) for El Capitan here https://gist.github.com/guycalledseven/31ffe35eca056838b06b
# XXX TODO
# should I disable com.google.Keystone.Agent ??
# http://applehelpwriter.com/2014/07/13/how-to-remove-googles-secret-update-software-from-your-mac/
# Stop DS_Store file creation on network connections
# restart Finder afterwards
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
CustomError.prototype = Object.create(Error.prototype);
@morganrallen
morganrallen / _README.md
Last active January 15, 2023 19:41
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active October 16, 2024 08:37
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@kessler
kessler / awsNodeBase.sh
Last active August 29, 2015 14:03
aws node base
echo "downloading scripts"
curl https://gist.githubusercontent.com/kessler/6122814/raw/002f1f919b937fd067a36f1a3b47050e4a3645e4/linux%20net%20settings > netchakra.sh
chomd +x netchakra.sh
curl https://gist.githubusercontent.com/kessler/5885063/raw/38f201ff740b25782bc04d3af11b4f3823478b4d/install-node > install-node.sh
chmod +x install-node.sh
curl https://gist.githubusercontent.com/kessler/6412374/raw/7b088bbeaf36ac845a6c2b6950d0e9f4d8d2d6b8/install-zeromq > install-zmq.sh
chmod +x install-zmq.sh
@kessler
kessler / async_recursion_example.js
Created July 4, 2014 15:07
async recursion example
var count = 0
var countWithDelay = 0
function recurse() {
console.log('recurse: %d', count)
if (count++ === 100) return
setImmediate(recurse)
}