Skip to content

Instantly share code, notes, and snippets.

View 67hz's full-sized avatar
🎼

Jake H 67hz

🎼
View GitHub Profile
@67hz
67hz / Lynx.md
Last active March 11, 2021 13:21
Lynx - A Working Man's Guide

The Working Man's Guide To Lynx

  • ? view help

customization

/etx/lynx.cfg

Set locations to bookmark file, jump file, enable key-bindings (vi|emacs), (white|black)list domains, cookies, and lots more.

@67hz
67hz / .bashrc
Created August 5, 2020 02:27
colorize man pages
man() {
LESS_TERMCAP_mb=$'\e[01;31m' \
LESS_TERMCAP_md=$'\e[01;33m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;44;19m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
command man "$@"
}
@67hz
67hz / CMakeLists.txt
Created March 21, 2020 04:42
C++ CMake starter - loads Gtest and Boost into deps - Change MainMain to whatever your app name is
cmake_minimum_required(VERSION 3.13.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
# for gdb - remove before prod
# this is left to developer
# run: cmake -DCMAKE_BUILD_TYPE=Debug ..
set(CMAKE_BUILD_TYPE Debug)
add_compile_options(-Wall -Wextra -Wpedantic)
@67hz
67hz / Makefile
Created March 12, 2020 20:41
Makefile for STM32 development
TARGET=main
CC=arm-none-eabi-gcc
LD=arm-none-eabi-gcc
AR=arm-none-eabi-ar
AS=arm-none-eabi-as
CP=arm-none-eabi-objcopy
OD=arm-none-eabi-objdump
SE=arm-none-eabi-size
SF=st-flash
@67hz
67hz / cc_notes.md
Last active February 28, 2020 22:45
@67hz
67hz / .ycm_extra_conf.py
Created February 28, 2020 20:40
Simple ycm_extra_conf.py with gtk support (adjust gtk path as necessary)
def Settings( ** kwargs):
return {
'flags': [
'-x',
'c',
'-std=c99',
'-Wall',
'-Wextra',
'-Werror',
'-I/usr/local/Cellar/gtk+3/3.24.14/include/gtk-3.0',
@67hz
67hz / erlang_notes.md
Last active July 26, 2019 01:19
My Erlang Notes circa 2004 with some recent additions

Erlang

  • let it crash philosophy - supervisors handle actor crashes
    • most common - restart actor with initial state
    • actor recieve messages in mailbox - can be across nodes
  • dynamically typed and strongly typed so no implicit conversion
  • atoms, tuples, pattern-matchingå
  • no true strings
  • atoms can't be garbage collected
  • Some BIFS implemented in C for speed
@67hz
67hz / main.asm
Created April 4, 2019 01:40
x86 Assembly: Scanning an array for a non-zero value
; Scanning array for non-zero value
.386
.model flat
.data
;intArray SWORD 0,0,0,0,4,3,0,-34,-56,7,8
intArray SWORD 0,0,0,0,0,0,0,0,0,0,0,0
.code
main proc
@67hz
67hz / finding_duplicates_in_string_using_bitwise_ops.cpp
Created March 27, 2019 00:18
A simple program to illustrate bitwise masking and merging to determine if a string contains duplicates.
// Simple program to illustrate bitwise ops to check string for duplicates
#include <iostream>
using namespace std;
int main()
{
char * A = new char[20];
cout << "Enter string to be checked for duplicates" << endl;
cin >> A;
@67hz
67hz / find_duplicates_in_unsorted_array.cpp
Last active April 13, 2019 01:47
passing array as ref to maintain size info in C++
// If std::array is not an option (e.g embedded), use the following tactic to maintain size info of array as param
// This method uses non-type template arguments to retain size of array.
// See std::begin() and std::end() for similar approaches.
#include <iostream>
using namespace std;
// @param h {T} represents highest number in given array
// used to determine size of hash array