This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| typedef enum { | |
| OP_CONST, // push constant | |
| OP_LOAD, // load local variable | |
| OP_ADD, // add top two values | |
| OP_CALL, // call function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // divisions of grid | |
| const float repeats = 30.; | |
| // number of layers | |
| const float layers = 21.; | |
| // star colours | |
| const vec3 blue = vec3(51.,64.,195.)/255.; | |
| const vec3 cyan = vec3(117.,250.,254.)/255.; | |
| const vec3 white = vec3(255.,255.,255.)/255.; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float ease(float x) { | |
| return pow(1.0 - x, 10.0); | |
| } | |
| float sdBox(in vec2 p, in vec2 xy, in vec2 b) | |
| { | |
| vec2 d = abs(p - xy) - b; | |
| return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # goto directory by name | |
| setopt autocd | |
| # zsh plugins | |
| source $HOME/.config/plugins/completion/completion.zsh | |
| source $HOME/.config/plugins/fsh/fast-syntax-highlighting.plugin.zsh | |
| source $HOME/.config/plugins/autosuggestions/zsh-autosuggestions.plugin.zsh | |
| # enable built in scripts | |
| source $HOME/.local/scripts/entry.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # usage: ./create_card.sh <background_image> "<song_name>" "<artist>" "<year>" "<duration>" | |
| # create base image with background | |
| magick "$1" -gravity center -extent 1186x640 base.png | |
| # add dark overlay | |
| magick base.png \( +clone -fill black -colorize 89% \) -composite overlay.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct GridLayout { | |
| raw: String, | |
| lines: Vec<String>, | |
| line_starts: Vec<usize>, | |
| } | |
| impl GridLayout { | |
| fn new(raw: String, max_width: usize) -> Self { | |
| let mut lines = Vec::new(); | |
| let mut line_starts = Vec::new(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| chk_root () { | |
| if [ ! $( id -u ) -eq 0 ]; then | |
| echo Must be run as root | |
| exit | |
| fi | |
| } | |
| chk_root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "type": "object", | |
| "properties": { | |
| "sysroot": { | |
| "type": "string", | |
| "description": "Path to the sysroot directory. The sysroot is where rustc looks for the crates that are built-in to rust, such as std." | |
| }, | |
| "sysroot_src": { | |
| "type": "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get current git statistics | |
| gitstats() { | |
| git log --shortstat --author="$(git config user.name)" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6; delta+=$4-$6; ratio=deleted/inserted} END {printf "Commit stats:\n- Files changed (total).. %s\n- Lines added (total).... %s\n- Lines deleted (total).. %s\n- Total lines (delta).... %s\n- Add./Del. ratio (1:n).. 1 : %s\n", files, inserted, deleted, delta, ratio }' - | |
| } | |
| # link homebrew items that aren't in path | |
| function blink() { | |
| local targetdir | |
| targetdir=($(brew --cellar $1)/*/bin) || return | |
| local linksdir=$(brew --repo)/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::{ | |
| fmt, | |
| net::{Ipv4Addr, Ipv6Addr}, | |
| str::FromStr, | |
| }; | |
| #[derive(Clone, Debug, PartialEq)] | |
| pub enum Types { | |
| IPv4, | |
| IPv6, |
NewerOlder