Skip to content

Instantly share code, notes, and snippets.

@codec4
codec4 / htoprc
Created November 3, 2024 15:55 — forked from janjitsu/htoprc
My Htop Setup
# Copy or symlink this file to ~/.config/htop/htoprc
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
# see more at https://dev.to/janjitsu/my-htop-setup-3fng
#
#
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=111
sort_direction=1
tree_sort_key=1
@codec4
codec4 / ranger-cheatsheet.md
Created October 20, 2024 10:54 — forked from heroheman/ranger-cheatsheet.md
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@codec4
codec4 / c.c
Created September 6, 2024 09:13 — forked from Ellpeck/c.c
A cheat sheet that I use for C programming
// Basically imports
// <> import something from a standard library location
// "" import something from an actual path
#include <stdio.h>
#include <stdlib.h>
// Preprocessor instructions with ifdef and ifndef, needs endif at the end
// ifndef = if not defined
#ifndef OOF
// Define a variable just to do the if check
@codec4
codec4 / pointers_and_arrays.c
Created September 6, 2024 09:11 — forked from mrnugget/pointers_and_arrays.c
Kind of a cheat sheet for pointers and arrays in C
#include <stdio.h>
int main(int argc, char *argv[])
{
// Taken from here: http://denniskubes.com/2012/08/19/pointers-and-arrays-in-c/
// initialize an array of ints
int numbers[5] = {1,2,3,4,5};
// standard array notation
@codec4
codec4 / update_git.sh
Created May 14, 2024 16:25 — forked from flaxel/update_git.sh
Update all git repositories in one folder
#!/bin/sh
# check if console program is installed
check_installation(){
type $1 >/dev/null 2>&1 || { echo >&2 "$1 is required: $2 Aborting."; exit 1; }
}
# printing usage information
usage(){
echo "This program is used to update all git repositories in the given folder."
@codec4
codec4 / clipboard.ts
Created November 2, 2023 15:14 — forked from max10rogerio/clipboard.ts
Example Copy to Clipboard with Typescript
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard
/**
* Interface CopyToClipboard params
*/
interface ICopyToClipboard {
/** HTML reference identifier ```<div id="foo"></div>``` */
target?: string;
/** String value */
value?: string;
@codec4
codec4 / Angular - custom structural directives.md
Created February 6, 2023 10:34 — forked from ih2502mk/Angular - custom structural directives.md
Writing your own structural directives with context variables

Writing your own structural directives with context variables

Complete code in math.directive.ts

After reading this you will be able to create a structural directive with inputs and context variables and use it like this:

<div *math="10; exponent: 3; let input; 
            let exponent = exponent; let r = root;
 let p = power; let ctrl = controller"&gt;