Skip to content

Instantly share code, notes, and snippets.

View dk949's full-sized avatar

David K dk949

View GitHub Profile
@dk949
dk949 / .vimrc
Last active December 20, 2024 18:50
*Very* basic vimrc to use on remote computers
" Options
filetype plugin on
filetype plugin indent on
syntax on
set number relativenumber
au InsertLeave * set number relativenumber
au InsertEnter * set number norelativenumber
@dk949
dk949 / cstimer_dracula.md
Created January 11, 2023 19:26
Dracula theme for cstimer.net

Dracula theme for csTimer

How to apply

In options go to the Color tab, select manual color scheme and press export. Paste the following code into the dialog box.

Just Ui colors

N4Igxg9gNhBOIC4QFcQBpzQLQDMIDsAXREAYhwA5KcAmdTKLAIwEMwBrE0mimlgZgBs9SIyYQWsACZcALPIDsAVhYjsTZIUIEuTKQE5+OfWsZQAlvk5JSSgAw4WCpqawwA5hC44AjI4pgrh4QrBxcPHxCIAC+QA
@dk949
dk949 / Makefile
Last active May 5, 2025 23:05
A makefiel for compileing C and C++ projects with support for debug and release modes.
########################### High level configuration ###########################
# If building a library (see DO_BUILD_LIB below) do not add prefix and extension
# i.e. use myLibName instead of libmyLibName.a
OUT_NAME = myExeName
VERSION=0.1.0
# Compiler, linker, archiver, package config
CC ?= gcc
CXX ?= g++
/* License: MIT. See end of file.
Overview:
This implementation is heavily based on macros (it's nothing but
macros). In order to get actual functions and structs they need to be
instantiated. Two helpers are provided for this: DECLARATIONS_Queue(T)
and DEFINITIONS_Queue(T). Place DECLARATIONS_Queue(T) in one (1) header
file. Place DEFINITIONS_Queue(T) in one (1) source file which includes
that header file. Define GENERIC_QUEUE_IMPL before including. Replace T
with your desired type. See example below
@dk949
dk949 / genslurm
Created October 13, 2022 09:25
Genrate slurm script
#!/bin/bash
set -e
___EXCLUSIVE="#SBATCH --exclusive"
___CPUS_PER_TASK="1"
help(){
echo "
Every option can be set from the command line or vie an env variable.
Command line takes priority.
@dk949
dk949 / e.hs
Last active January 10, 2024 19:52
e
module E where
e = sum $ take 171 $ map ((\a b -> fromIntegral a / fromIntegral b) 1 . \f -> product [1 .. f]) [0 ..]
main = print e
@dk949
dk949 / pegd.d
Created October 1, 2022 20:21
read PEG file and generate a D parser for it with pegged
/+dub.json:
{
"authors": ["dk949" ],
"copyright": "Copyright © 2022, dk949",
"dependencies": { "pegged": "~>0.4.6" },
"description": "compiler for standalone pegged grammars",
"license": "BSL-1.0",
"name": "pegd"
}
+/
@dk949
dk949 / wsl_debian_testing.md
Last active September 23, 2022 00:44
Debian testing on WSL
@dk949
dk949 / msgpack2json.d
Created September 3, 2022 08:33
COnvert msgpack to json
/+dub.json:
{
"authors": ["dk949"],
"copyright": "Copyright © 2022, dk949",
"dependencies": {"msgpack-d": "~>1.0.4"},
"description": "Convert msgpack to JSON",
"license": "MIT",
"name": "msgpack2json"
}
+/
@dk949
dk949 / commands.md
Last active January 10, 2024 19:47
List of two letter *nix applications

Two letter applications

A large number of unix utilities have two letter names, like rm, mv, cp etc. You may have wandered which have already been used. There is a very high chance that all 676 possible ones have been used by someone, but here is a list of the ones found in the Arch repos.

Generated on 2024-01-10. 139 valid two letter commands were found. Code for generating this document is included as a comment at the end.

  • ab:
    • extra/apache
  • ag:
  • extra/the_silver_searcher