Skip to content

Instantly share code, notes, and snippets.

View danhab99's full-sized avatar
🏳️‍🌈
Sometimes you have to stop, and patch the bugs in your own life.

Dan Habot danhab99

🏳️‍🌈
Sometimes you have to stop, and patch the bugs in your own life.
View GitHub Profile
locals {
labels = {
"app" = "mongo"
}
volume_config_name = "mongo-config"
}
module "mongo" {
source = "terraform-iaac/stateful-set/kubernetes"
version = "1.4.2"
@danhab99
danhab99 / i3_keybindings.md
Created January 21, 2022 03:32
I3 keybindings for moving the mouse

I3 Keybindings For Moving The Mouse

This is really just meant to be goofy, noone should use this instead of a mouse.

Installation

Add these lines to your i3 config.

bindsym $mod+Mod1+h exec xdotool mousemove_relative -p 270 10
@danhab99
danhab99 / demo.test.js
Last active October 29, 2021 16:37
Cannot pass state from jest wrapper to sub tests
const EXAMPLE_KEY = "example key";
const describeWrapper = (label, opts, tests) => {
describe(label, () => {
var State = undefined;
beforeAll(async () => {
// acquiring the state irl has to be done asynchronously
State = EXAMPLE_KEY;
})
@danhab99
danhab99 / i3blocks config
Created April 1, 2020 17:58 — forked from Lukewh/i3blocks config
i3 bar for motivation in these times of working from home. Thanks https://gofuckingwork.com/
[motivation]
command=/path/to/motivation/script/motivation
interval=900
@danhab99
danhab99 / switch.js
Created March 4, 2020 16:41
A view switching component for react
/**
Component will show the view named in `current` as defined by it's corresponding attribute.
Usage:
import Switch from './switch'
import Main from './main_view'
import Secondary from './secondary_view'
ReactDOM.render(<Switch current="main" main={<Main />} secondary={<Secondary />} />
*/
@danhab99
danhab99 / linkedlist.cpp
Last active November 23, 2019 00:16
bcc-cis-277-602-2019
#include <iostream>
using namespace std;
// Changes the input type for the user, type must support comparison logic
typedef string INPUT_TYPE;
struct Node {
INPUT_TYPE data;
Node *next;
Node *last;
@danhab99
danhab99 / factorial.py
Last active November 20, 2019 02:56
Definitions described here https://youtu.be/2gKxuBoxIm0
# Definitions described here https://youtu.be/2gKxuBoxIm0
def factorial(n):
if n == 1:
return n
else:
return n * factorial(n - 1)
def super_factorial(n):
def sf(n):
package utils
import (
"bufio"
"os"
)
func chanNBRead(c chan bool, def bool) bool {
var e bool
select {
In total, 7 object ids were changed. Full details are logged here:
/.../asddfknjsanf.bfg-report/2019-07-15/10-47-07
BFG run is complete! When ready, run: git reflog expire --expire=now --all && git gc --prune=now --aggressive
--
You can rewrite history in Git - don't let Trump do it for real!
Trump's administration has lied consistently, to make people give up on ever
@danhab99
danhab99 / sleepsort.js
Created April 19, 2019 03:10
The worst thing ever
const sleepsort = (arr, callback) => {
for (var a in arr) {
setTimeout((i) => callback(i), a, a);
}
}
let test = [39, 9, 34, 26, 3, 30, 31, 18, 21, 3, 38, 7, 13, 16, 27, 21, 18, 8, 8, 38, 2, 11, 29, 11, 22, 28, 22, 9, 12, 0, 18, 2, 30, 29, 14, 23, 27, 38, 22, 22]
sleepsort(test, i => console.log(i));