Skip to content

Instantly share code, notes, and snippets.

View cdriehuys's full-sized avatar

Chathan Driehuys cdriehuys

View GitHub Profile
@cdriehuys
cdriehuys / script.sh
Created August 3, 2021 15:48
Grant USB access for flashing firmware of Prusa MK3S
#!/bin/bash
# Copied from a comment by @Vedrillan
# https://github.com/prusa3d/PrusaSlicer/issues/1055#issuecomment-633557131
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c99" TAG+="uaccess", TAG+="udev-acl"' | sudo tee /etc/udev/rules.d/20-prusa.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
@cdriehuys
cdriehuys / Axios Nock and Typescript.md
Last active September 14, 2022 17:07
Typescript definition file to make axios work with nock

Axios, Nock, and Typescript

There is a documented issue describing how axios and nock do not work well together. The workaround described in this comment works.

import axios from 'axios';
import httpAdapter from 'axios/lib/adapters/http';
import nock from 'nock';

axios.defaults.adapter = httpAdapter;

Keybase proof

I hereby claim:

  • I am cdriehuys on github.
  • I am cdriehuys (https://keybase.io/cdriehuys) on keybase.
  • I have a public key whose fingerprint is F25D B5AD BCCE 3EE4 FBF8 6245 40B7 2DD4 F5DC 2B91

To claim this, I am signing this object:

@cdriehuys
cdriehuys / create-py-project
Last active November 6, 2018 01:03
A script to make creating python projects easier.
#! /bin/bash
ENV_NAME='env'
PYTHON_NAME='python3'
project_name=$1
function configure_sublime() {
env_dir=$(readlink -f $project_name/$ENV_NAME)