Skip to content

Instantly share code, notes, and snippets.

View maximecb's full-sized avatar

Maxime Chevalier-Boisvert maximecb

View GitHub Profile
// Header files
#include "random.h"
// Initialize the constants for 64 bit random values
// Xn+1 = A * Xn + B (mod 2^64)
const uint64 CRandomGenerator::A_CONSTANT_64 = (uint64)(0x27BB2EE6)*(0x010000)*(0x010000) + (uint64)(0x87B0B0F);
const uint64 CRandomGenerator::B_CONSTANT_64 = 0xB504F32D;
// Initialize the constants for 32 bit random values
// Xn+1 = A * Xn + B (mod 2^32)

Staff Compiler Engineer (Rust YJIT)

The Ruby and Rails Infrastructure Team is responsible to ensure that Shopify uses Ruby and Rails the right way, and that they both work well for Shopify. We work closely with the open-source community and with teams within Shopify to understand common problems in Shopify’s Ruby applications, fix them at the language or framework level, standardize the solution for all other Shopify repos, and contribute our solutions back upstream for the broader community to use. We work in almost all layers, all the way from fixing business logic to operating system debugging.

Ruby and Rails are crucial pieces of our infrastructure. These tools sometimes don’t scale to our needs and we are working to improve them with the help of the community, making things better both internally and externally.

The YJIT project is one of those efforts, developing a new JIT compiler for the Ruby programming language. The project is based on a technique called Lazy Basic Block Versioning that was dev

@maximecb
maximecb / music.csv
Created May 19, 2018 17:21
Python program to sequence MIDI music using a CSV spreadsheet
X kick snare
X
X
X
X kick
X
X
X
X kick snare clap
X
@maximecb
maximecb / xarm_control.py
Last active July 4, 2022 22:26
Simple class to control the LewanSoul XArm over the USBHID interface
"""
sudo apt-get install libhidapi-hidraw0 libhidapi-libusb0
pip3 install --user hid
Notes:
- servos_off will power off the servos
- sending a movement command wakes up unpowered servos
- position readouts are sadly pretty slow, they can take up to 450ms
"""
This file has been truncated, but you can view the full file.
def fun_l0_n0(x)
if (x < 1)
fun_l1_n310(x)
else
fun_l1_n485(x)
end
end
def fun_l0_n1(x)
if (x < 1)