Skip to content

Instantly share code, notes, and snippets.

Avatar
🌻

Charlton Trezevant ctrezevant

🌻
View GitHub Profile
@ctrezevant
ctrezevant / debugf.h
Last active May 29, 2020
A tiny little macro to help debug your C code.
View debugf.h
// debugf.h
// Charlton Trezevant - 2018
// MIT license
/* USAGE:
* To use this macro, simply paste it into your source file (you may also
* include debugf.h if you have many source files). Doing this will define
* the function debugf(), which acts as a thin wrapper around fprintf() with
* a little added pizazz.
*
@robey
robey / apple1-rom.txt
Last active Jul 18, 2019
apple 1 ROM disassembly
View apple1-rom.txt
;
; the "monitor ROM" of an apple 1 fit in one page (256 bytes).
;
; this is my attempt to take the disassembled code, give names to the
; variables and routines, and try to document how it worked.
;
;
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a
; peripheral chip that drove the keyboard and video. the video was run by a
; side processor that could treat the display as an append-only terminal that
@Xjs
Xjs / wasm-table.go
Created Aug 30, 2018
Call insertRow() from wasm in Go
View wasm-table.go
package main
import (
"syscall/js"
)
func main() {
document := js.Global().Get("document")
table := document.Call("getElementById", "myTable")
@mndrix
mndrix / sms.go
Last active Jun 23, 2020
SMS over IRC
View sms.go
// A proxy for sending/receiving SMS via IRC
//
// This code is part of our family IRC server whose code is available at
// https://gist.github.com/mndrix/7947009178e4a18c247b4bd25821661f
//
// This file won't compile by itself because it's only one file from
// my larger family server (movie hosting, Asterisk dialplan, Git
// hosting, personal assistant, etc).
//
// Copyright 2018 Michael Hendricks
@clipperhouse
clipperhouse / medium2md.go
Last active Apr 29, 2019
A Go script to convert Medium export (HTML) to Markdown, for use with Hugo. It’s a one-use type of thing for me, so it ain’t beautiful.
View medium2md.go
// A quick script for converting Medium HTML files to Markdown, suitable for use in a static file generator such as Hugo or Jekyll
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
@nathankerr
nathankerr / Info.plist
Last active Mar 28, 2021
Registering a Go app as a protocol handler under Mac OS X
View Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>myapp</string>
<key>CFBundleIdentifier</key>
<string>com.pocketgophers.myapp</string>
<key>CFBundleURLTypes</key>
<array>
@ugate
ugate / setup.sh
Last active Jan 25, 2018
NTC C.H.I.P. setup script
View setup.sh
#!/bin/bash
LC_ALL=en_US.UTF-8
# configures/installs common CHIP features (including enabling disabled ones)
# run 'sudo chmod +x setup.sh && ./setup.sh' to run the installation
clear
res=
dtc=
rboot=
uname -a
cat << _EOF_
View Principles-of-Adult-Behavior.md

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@0XDE57
0XDE57 / config.md
Last active Apr 10, 2021
Firefox about:config privacy settings
View config.md

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@andychase
andychase / googleforms2slack.gs
Last active Mar 17, 2021
Google Forms Slack Notification
View googleforms2slack.gs
// Google Forms Slack Notification
// Andy Chase <github.com/andychase>
// License: CC0 1.0 Universal <creativecommons.org/publicdomain/zero/1.0>
// Install 1: This code goes in ( tools > script editor... ) of your google docs form
// Install 2: ( resources > current project triggers ) ( [onSubmit], [from Form], [On form submit] )
// Setup 1: Put your slack api url below
var POST_URL = "https://hooks.slack.com/services/";
function onSubmit(e) {