Skip to content

Instantly share code, notes, and snippets.

@while0pass
while0pass / listchars.vim
Last active July 9, 2024 15:13
show/hide hidden characters in Vim
" hide hidden chars
:set nolist
" show hidden characters in Vim
:set list
" settings for hidden chars
" what particular chars they are displayed with
:set lcs=tab:▒░,trail:▓,nbsp:░
" or
@smhanov
smhanov / dawg.py
Last active September 5, 2024 19:18
Use a DAWG as a map
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article.
#
# Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata."
# Computational linguistics 26.1 (2000): 3-16.
#
# Updated 2014 to use DAWG as a mapping; see
# Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies",
# Software-Practice and Experience 1993
@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active November 17, 2024 11:04
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@shoogle
shoogle / qt-without-xcode.md
Last active August 13, 2024 09:48
Qt without XCode - how to use Qt Creator for macOS software development without installing XCode

Qt without Xcode

How to use Qt Creator for software development on macOS without having to install Xcode

Justification

Qt refuses to install on macOS unless Apple's Xcode is installed beforehand. This is unfortunate because:

@codehoose
codehoose / bbclient.cpp
Created November 10, 2018 23:56
Barebones TCP client for Linux
#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <string.h>
#include <string>
using namespace std;

Art of Debugging

Obligatory disclaimer, this is all opinion and cannot possibly generalize to all problems, workflows, environments, etc. This is meant primarily as a launching point for an open-ended discussion on best practices in debugging code. This is a sketch of what may be a brief book that covers each point below with anecdotes, examples, and techniques.

Hypothesis 0

The ultimate goal of a debugging session is to rule out possibilities until only one remains. All applications of best practices, techniques, and tools should be pointed at this purpose (contextualize all points below against this statement). Debugging is first and foremost a critical thinking problem, and presence of mind is your most critical asset. Establish a mental model but do not be afraid to invalidate it as the investigation unfolds.

sherlock

Hypothesis 1

@chbtoys
chbtoys / 00-signalgenerators.cpp
Created July 17, 2022 09:32
audio programming - beginner level
// Signal Generators
//
// Compile: clang++ -std=c++20 -lpng 00-signalgenerators.cpp -o 00-signalgenerators
//
// If #include <png++/png.hpp> is missing:
// > brew install png++
// png++ (header-only) is used to render audio as images to visualize the waveform.
// Install with homebrew on macOS or with other package manager.
// https://savannah.nongnu.org/projects/pngpp/
//
@chbtoys
chbtoys / 03-formant.cpp
Created July 17, 2022 09:39
audio programming - beginner level
// compile: clang++ -std=c++20 -lpng 03-formant.cpp -o 03-formant
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <random>
#include <filesystem>
#include "indicators.hpp"
#include <png++/png.hpp>
#include "AudioFile/AudioFile.h"