View findstart.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findStart(strArr) { | |
const stations = strArr.slice(1).map((station) => station.split(':').map(parseInt)) | |
for (let i = 0; i < stations.length; i++) { | |
for (let i = 0; i < stations.length; i++) { | |
let curGal = 0 | |
let total = 0; | |
for (let j = 0; j < stations.length; j++) { | |
const [gallons] = stations[i + j % stations.length] | |
const [_, needed] = stations[(i + j + 1) % stations.length] | |
curGal += gallons; |
View .xsetwacom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sudo -i -u zwhitchcox xsetwacom set 'Wacom Intuos4 4x6 Pen stylus' button 3 '0' | |
# make sure to chmod this script with `chmod +x /home/zwhitchcox/.xsetwacom` |
View slash-etc-slash-X11-slash-xorg.conf.d-slash-20-nvidia.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixes issue where laptop's monitor ports are connected to the dGPU, while the laptop screen is connected | |
# to the iGPU. This can cause extreme lag when laptop lid is closed, for soem reason (possibly the iGPU | |
# is turned off and thus unable to render the graphics). This configuration lets the iGPU render/display | |
# for the laptop and the dGPU render/display for the external monitors. | |
# Correction: Actually, it looks like all monitors are using the NVIDA driver. However, if I remove the | |
# first section, my laptop lid doesn't work so, idk | |
# This section sets up the Intel integrated graphics as the primary driver |
View resume.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"basics": { | |
"name": "Zane Hitchcox", | |
"label": "(Hardware/Software) (Engineer/Hacker)", | |
"email": "zwhitchcox@gmail.com", | |
"phone": "865.236.0804", | |
"url": "https://zanehitchcox.com", | |
"summary": "I'm a hardware and software engineer and hacker.\nI like solving challenging problems and creating innovative technology.\nMostly web focused and early adopter of things like NodeJS, React, Rust, Docker, Kubernetes, WASM/WASI, etc.", | |
"location": { | |
"city": "Knoxville", |
View gist:7fe9e9b4f60a021e378938f592dd5284
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make clean | |
emconfigure ./configure --host=x86_64-gnu-linux --prefix=$(readlink -f prefix) --disable-imager --disable-defrag --disable-tls --disable-uuidd --disable-mmp --disable-tdb --disable-bmap-stats --disable-nls --disable-fuse2fs --disable-fsck --disable-libuuid --without-pthread CFLAGS="" | |
cp -f ../e2fsprogs/lib/ext2fs/gen_crc32ctable ./lib/ext2fs/gen_crc32ctable | |
cp -f ../e2fsprogs/util/subst ./util/subst | |
chmod +x ./util/subst | |
emmake make | |
echo 'resize2fs.js: $(RESIZE_OBJS) $(DEPLIBS) |
View snippets.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const zbug = (...args: any[]) => { | |
const stack = ((new Error).stack?.split('\n') as any[]) | |
.map((line: string) => line.substring(line.lastIndexOf('/') + 1)); | |
const _args: any[] = [...stack?.slice(2,3), ...args]; | |
// @ts-ignore | |
return _debug('node-raspberrypi-usbboot')(..._args); | |
} |
View Dockerfile.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
RUN apt-get update | |
RUN apt-get install -yqq apt-utils | |
RUN apt-get install -yqq vim | |
# # device tree | |
RUN apt-get install -yqq i2c-tools | |
RUN apt-get install -yqq device-tree-compiler | |
# dtc -I fs /sys/firmware/devicetree/base > cur.dts |
View sbc-imx8-no-wp.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/dts-v1/; | |
/ { | |
compatible = "compulab,sbc-imx8\0compulab,cl-som-imx8,rev1.1\0compulab,cl-som-imx8\0fsl,imx8mq"; | |
interrupt-parent = <0x01>; | |
#address-cells = <0x02>; | |
#size-cells = <0x02>; | |
model = "CompuLab CL-SOM-iMX8 rev1.1 on SBC-iMX8"; | |
cpus { |
View console.log.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple Public Service Announcement | |
// You can add variables to your variables on console.log | |
// by using the es6 shorthand | |
```js | |
console.log({variable}) | |
``` | |
// I just realized that |
View launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "lldb", | |
"request": "launch", | |
"name": "Cargo test", | |
"cargo": { | |
"args": ["test", "--no-run", "--lib"] | |
}, |
NewerOlder