Skip to content

Instantly share code, notes, and snippets.

View donbright's full-sized avatar

don bright donbright

View GitHub Profile
@sachee
sachee / keymap.c
Created March 23, 2019 23:45
sachee dactyl keyboard layout
#include "Dactyl.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
#define _QWERTY 0
#define _NUMLAYER 1
enum custom_keycodes {
QWERTY,
NUMLAYER
@cb372
cb372 / riscv.md
Last active June 8, 2024 10:09
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@lucasw
lucasw / linux_nes.md
Last active October 30, 2021 15:07
Linux Nintendo NES development

Ubuntu 16.04

install cc65

mkdir ~/other
cd ~/other
git clone https://github.com/cc65/cc65
cd cc65
make
@rdp
rdp / rat.go
Created June 21, 2016 15:54
golang use rational numbers example
package main
import "math/big"
import "fmt"
import "time"
func main() {
fmt.Printf("Hello, world.\n")
start := time.Now()
@runsun
runsun / runscad.py
Created September 27, 2015 07:18
Run an openscad file once or n times and save shape output to file(s)
##########################################################################
## runscad.py
##
## Run an openscad file once or n times and save shape output to file(s)
##
## by Runsun Pan (2015.9.25)
###########################################3##############################
import sys, os, re
narg = len(sys.argv)
@huonw
huonw / blackmagic.rs
Created January 15, 2014 12:42
do-while loops in Rust
while {
let x = foo();
bar(x);
x != 0
} {}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 24, 2024 06:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@endolith
endolith / readme.md
Last active May 22, 2024 07:13
How to stream a webcam to a web browser in Ubuntu

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion

~> nano ~/.motion/motion.conf