Skip to content

Instantly share code, notes, and snippets.

View juliangroen's full-sized avatar
🌸
░▒▓ CODING DREAMS ▓▒░

Julian Groen juliangroen

🌸
░▒▓ CODING DREAMS ▓▒░
View GitHub Profile
@juliangroen
juliangroen / alacritty.yml
Created March 10, 2020 06:14
Alacritty Config
# Font Settings
# Font family
font:
normal:
family: DejaVu Sans Mono Nerd Font Complete
bold:
family: DejaVu Sans Mono Bold Nerd Font Complete
@juliangroen
juliangroen / purecssmenu.html
Created June 25, 2020 06:41
Pure CSS Mobile Menu
<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Taniti</title>
<link rel="stylesheet" href="styles.css" />
</head>
ftStart=".avi"
ftEnd=".mp4"
for file in $(find . -name '*.sm'); do
echo changing ${ftStart} to ${ftEnd} in ${file}
sed -i "s/${ftStart}/${ftEnd}/g" ${file}
done

Partitions

Scheme

# efi boot - fat32 - 512MB
/dev/sda1

# root - ext4 - rest of drive
/dev/sda2

# swap - swapfile - same as main memory
@juliangroen
juliangroen / getres.sh
Last active July 19, 2020 15:12
Bash script to get current resolution values from xrandr. Use -h for horizontal and -v for vertical.
#!/bin/bash
str=`xrandr | grep '*'`
IFS='x'
read -ra ADDR <<< "$str"
IFS=' '
read -ra ADDR2 <<< "${ADDR[1]}"
while getopts 'hv' flag; do
case "${flag}" in
@juliangroen
juliangroen / testdzen2.sh
Created July 17, 2020 18:50
Bash script to display a centered notification with dzen2. Uses getres.sh script.
res_h=`~/.scripts/getres.sh -h`
res_v=`~/.scripts/getres.sh -v`
height=128
width=256
let "pos_x=(${res_h}/2)-(${width}/2)"
let "pos_y=(${res_v}/2)-(${height}/2)"
date +"%r %dth %B, %Y" | dzen2 -p 4 -h $height -w $width -x $pos_x -y $pos_y
@juliangroen
juliangroen / paging.js
Last active August 2, 2020 03:24
Simple example of memory paging using a FIFO algorithim.
// first frame
const a = [];
// second frame
const b = [];
// third frame
const c = [];
// queue to track oldest frame
module.exports = {
purge: {
mode: 'all',
content: ['./**/**/*.html', './**/**/*.svelte'],
options: {
whitelistPatterns: [/svelte-/],
defaultExtractor: (content) => [...content.matchAll(/(?:class:)*([\w\d-/:%.]+)/gm)].map(([_match, group, ..._rest]) => group),
},
},
// score data
const dolphinsScores = [97, 112, 101];
const koalasScores = [109, 95, 106];
// helper function to average array values
const avgScore = (array) =>
// array.reduce iterated through an array and adds each value together.
// then divide the result agaisn't the legnth of the array to get the average.
array.reduce((acc, val) => acc + val) / array.length;
@juliangroen
juliangroen / .foolzprompt
Last active August 18, 2021 20:46
foolzprompt
##############################
# #
# .foolzprompt #
# customized bash PS1 prompt #
# #
##############################
# function to detect the git branch of the current directory
parse_git_branch() {