Skip to content

Instantly share code, notes, and snippets.

View rjmacarthy's full-sized avatar
🎮
The Tetris effect

rj rjmacarthy

🎮
The Tetris effect
  • The Wilderness
  • 18:54 (UTC)
View GitHub Profile
@rjmacarthy
rjmacarthy / shortcuts.md
Last active June 1, 2023 10:59
keyboard shortcuts for ecosse/nvim

NVim Configuration Cheat Sheet

This is a quick reference guide for NVim configuration key bindings for https://github.com/ecosse3/nvim

File Explorer

Key Bindings Description
<C - e> Open File Explorer
Backspace Back to file explorer (in editor normal mode)
@halfelf
halfelf / how_to_build_a_fast_limit_order_book.md
Created February 11, 2019 02:18
How to Build a Fast Limit Order Book

https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/

The response to my first few posts has been much larger than I’d imagined and I’d like to thank everyone for the encouragement.

If you’re interested in building a trading system I recommend first reading my previous post on general ideas to keep in mind.

My first really technical post will be on how to build a limit order book, probably the single most important component of a trading system. Because the data structure chosen to represent the limit order book will be the primary source of market information for trading models, it is important to make it both absolutely correct and extremely fast.

To give some idea of the data volumes, the Nasdaq TotalView ITCH feed, which is every event in every instrument traded on the Nasdaq, can have data rates of 20+ gigabytes/day with spikes of 3 megabytes/second or more. The individual messages average about 20 bytes each so this means handling

@carlos8f
carlos8f / gist:8367d1d1aeb83062457f293425ec0e03
Created May 28, 2017 05:36
zenbot sim result, 1m period, gdax.ETH-USD, 4 days, 72.97% profit, 68.77% over buy/hold
zenbot sim gdax.ETH-USD --trend_ema 21 --period 1m --max_slippage 0.001 --order_adjust_time 5000 --oversold_rsi_periods 13 --oversold_rsi 14 --neutral_rate 0.01 --days 4
start: 2017-05-23 16:07:00
end: 2017-05-27 22:30:00
{
"asset_capital": 0,
"buy_pct": 98,
"buy_stop_pct": 0,
"currency_capital": 1000,
@MeLlamoPablo
MeLlamoPablo / nvmlink
Created February 1, 2017 11:34
Creates a symlink to /usr/bin/node after using nvm
import React from 'react'
import ReactDOM from 'react-dom'
import { createStore, combineReducers } from 'redux'
import * as R from 'ramda'
// composition helper
const combine = R.curry((c, o) => x => (<div>{c(x)} {o(x)}</div>))
const combineComponents = (...args) => {
const [first, ...rest] = args
return R.reduce((acc, c) => combine(acc, c), first, rest)
contract DataVerifiable {
/// @notice throws if ether was sent accidentally
modifier refundEtherSentByAccident() {
if(msg.value > 0) throw;
_
}
/// @notice throw if an address is invalid
import "EternalStorage.sol";
library ProposalsLibrary {
function getProposalCount(address _storageContract) constant returns(uint256)
{
return EternalStorage(_storageContract).getUIntValue(sha3("ProposalCount"));
}
function addProposal(address _storageContract, bytes32 _name)
contract EternalStorage{
mapping(bytes32 => uint) UIntStorage;
function getUIntValue(bytes32 record) constant returns (uint){
return UIntStorage[record];
}
function setUIntValue(bytes32 record, uint value)
{
export const INCREASE = 'INCREASE';
export const DECREASE = 'DECREASE';
@nickpiesco
nickpiesco / README.md
Created October 16, 2015 14:46
DRY out Media Queries with React and Radium

Here at Bloomfire, we’re loving building new components with React. We’re even going all in with using ES6 modules and inline styles. (‘Inline styles?!’ I hear you say? Don’t knock it ’til you’ve tried it.)

There’s a lot of cool stuff we can do with CSS that we can’t do with inline styles, though; and that’s where Radium comes in. Radium not only provides a handy way to style :hover, :focus, and :active states, but it also deftly handles media queries. If you’re using inline styles in React and not using Radium, you should. I’ll give you a minute to go look it over – here’s the link again.

Back? Okay.

We create a style object in each of our React components, which we then reference in the JSX below. Here’s a super-stripped-down example:

// [myAwesomeButton.js]