Skip to content

Instantly share code, notes, and snippets.

View Micrified's full-sized avatar
🇫🇷
Collating...

Micrified

🇫🇷
Collating...
  • Rotterdam, Nederlands
View GitHub Profile
@Micrified
Micrified / cubegames2.go
Created December 5, 2023 09:00
Advent of Code; Exercise 2; Part 2
package main
import (
"fmt"
"bufio"
"os"
"strings"
"math"
)
@Micrified
Micrified / cubegames.go
Created December 4, 2023 12:09
Day 2 Advent of Code (part 1)
package main
import (
"fmt"
"bufio"
"os"
"strings"
)
func gamePossible (line string, constraints map[string]int) bool {
@Micrified
Micrified / receiver-generics.go
Created December 3, 2023 16:13
Experimentation with handling heterogenous receivers with generics in Go
// Online Go compiler to run Golang program online
// Print "Hello World!" message
package main
import "fmt"
// Type A, normal receiver, and pointer receiver
type A struct {
s string
}
@Micrified
Micrified / tyler_the_creator_v1
Created October 10, 2023 09:41
Tyler, the Creator (Verse 1)
Yo, who dat boy? Who him is?
Him that ni-gga, I swear
Stand out guy, him don't need no chair
Well, where the fuck him at? 'Cause nigga, I'm right here
I don't shop at the mall, all y'all just
Dumb mothafucka, I'm a goddamn artist
You can give me some markers and I'll draw you a closet
And you know that it's GOLF, bitch, gonna make the deposit
Nigga fresh to death like he got dressed in a coffin
Cons, overalls, and a striped shirt
@Micrified
Micrified / anno_feature_feasibility.md
Last active September 27, 2023 12:05
Snapshot feasibility study for desired AnnoWatch feature-set.

Introduction

This document looks into whether key features are supported and/or possible by examining existing standards, protocols, and libraries on the target platforms of the AnnoWatch project. The document will proceed in the following order:

  1. Requirements: What is the feature-set AnnoWatch requires.
  2. MFi: A brief foray and examination of Apple's MFi program. Includes clearing it with our requirements.
  3. Bluetooth: A look into the various bluetooth profiles and services needed for the device to fulfill its functions, along with their compatibility with desired Bluetooth standards.
  4. Conclusion: Summary of findings and recommendations

@Micrified
Micrified / payslip2text.sh
Created July 25, 2023 21:15
Convert a Payslip to text format
#!/bin/sh
# payslip2text: Convert <company> payslip(s) to text form
# awk: extract fields
PP='/^If undeliverable/ { printf "%s-%s\n", $8, $9 }
/^Gross Salary/ { print $3 };
/^Contr.employer Health Ins/ { print $4 };
/^Pension fund premium/ { print $4 };
/^PAWW contribution/ { print $3 };
/^Taxable wage/ { print $3 };
@Micrified
Micrified / vim_language_servers.md
Created April 21, 2023 23:01
Language Servers with VIM

Introduction

Autocompletion is certainly easily attainable for VIM through AutoComplPop, which provides a sort of simplistic suggestion approach using previously encountered words. However, auto-completion for languages is not provided. If you want that, you need to look to language servers. Language servers are effectively processes that abide by some kind of protocol and provide tips, corrections, and other language-specific feedback. An open source standard called the Language Server Protocol is available.

To make use of language server support via the Language Server Protocol, two separate components are needed:

  1. A language-server implementation that complies with the language server protocol
  2. A plugin for your editor or IDE that can take advantage of different language servers

@Micrified
Micrified / align
Created April 14, 2023 21:26
Aligns lines based on input character (for use with vim)
#!/bin/sh
# align: align a series of lines based on a character (default '=')
# Lines with no occurrences are passed through
# Lines with multiple occurrences are aligned at first
# occurrence
CHAR='='
# argument processing
while getopts "c:" arg; do
case $arg in
@Micrified
Micrified / about_man.md
Last active February 24, 2023 22:55
Man pages

Creating your own manual (MAN) page

UNIX systems tools are typically accompanied by a man page. These provide a brief description of the command, it's optional parameters and modes, and any other related information that may be of use to the user.

Formatting Customs

  • Almost all Unix MAN pages use the section numbering: (1) NAME, (2) SYNOPSIS, (3) DESCRIPTION, (4) FILES - files the command might use to do work, (5) SEE ALSO, (6) NOTES, (7) AUTHOR, (8) BUGS, with extra and optional sections as needed.
  • You normally have an initial line: Foo /- Does foo things with this dash that gives a short description. This allows the man-page to be added to the 'whatis' database used by man -k and apropos commands, if applicable.
  • Boldface is typically used to denote program and filenames

Basic commands

  1. \fB : Change font to boldface
@Micrified
Micrified / vim.md
Last active November 24, 2023 15:08
VIM User Manual

VIM

Basic Operations

Basics

Input Action
CTRL+U Page up 1/2
CTRL+D Page dw 1/2