Skip to content

Instantly share code, notes, and snippets.

@hanchang
hanchang / main.rs
Created December 1, 2023 00:53 — forked from chrishulbert/main.rs
Interactive Brokers TWS API in Rust
// MIT licensed.
use std::net::TcpStream;
use std::io::{Read, Write};
use std::sync::mpsc::channel;
use std::thread;
fn main() {
let mut stream = TcpStream::connect("127.0.0.1:7496").expect("connect");
stream.set_nodelay(true).expect("nodelay"); // Because we're wannabe HFT traders.
@hanchang
hanchang / not_too_clever.md
Created June 24, 2022 01:30 — forked from raphlinus/not_too_clever.md
Translation of grugbrain.dev into English

The not-too-clever programmer

This is a translation of grugbrain.dev into clear English. All props to the original author.

Introduction

This is a collection of thoughts on software development, originally written by an pseudonymous author styling themselves the "grug brain developer," but then translated into clear English by Raph Levien.

I am not an extremely smart developer, but I have many years of experience and have learned some things, although still don't know everything.

@hanchang
hanchang / music_theory.py
Created April 20, 2021 14:46 — forked from mvanga/music_theory.py
Basic Music Theory in ~200 Lines of Python
# The code for my article with the same name. You can find it at the URL below:
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@hanchang
hanchang / insert-signature-in-pdf.md
Created September 20, 2020 01:46 — forked from chrpinedo/insert-signature-in-pdf.md
How to insert your signature in a PDF file by using PDFtk

How to insert your signature in a PDF file by using PDFtk

Your signature in all the sheets

  1. convert the signature image to PDF file
convert firma.png firma.pdf
@hanchang
hanchang / worker.js
Created July 27, 2020 05:10 — forked from maxkostinevich/worker.js
Serverless Geolocation Service
/*
* Serverless Geolocation Service, hosted on Cloudflare Workers.
*
* Learn more at https://maxkostinevich.com/blog/serverless-geolocation
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
// https://gist.github.com/maephisto/9228207
remote: -----> SystemFonts app detected
remote: -----> Extracting fonts to /tmp/build_948df2f102ae1f666593d4fdfb9858bf/.fonts
remote: ./fonts/
remote: ./fonts/Arial Bold.ttf
remote: ./fonts/Arial.ttf
remote: ./fonts/Arial Bold Italic.ttf
remote: ./fonts/Arial Italic.ttf
remote: /usr/share/fonts: caching, new cache contents: 0 fonts, 4 dirs
remote: /usr/share/fonts/cMap: caching, new cache contents: 0 fonts, 0 dirs
remote: /usr/share/fonts/cmap: caching, new cache contents: 0 fonts, 5 dirs
@hanchang
hanchang / bobp-python.md
Last active July 29, 2019 23:47 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@hanchang
hanchang / Rolling 30 Day Correlations.ipynb
Created April 13, 2019 00:55 — forked from anthonytxie/Rolling 30 Day Correlations.ipynb
Rolling 30 Day Correlations between BTC & BCH
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.