This file contains 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 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 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 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 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 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, |
This file contains 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
// minified | |
class Log{public static final String RESET="\u001B[0m";public static final String RED="\u001B[31m";public static final String CYAN="\u001B[36m";static void p(Boolean ln,Boolean err,Object... args){java.io.Console console=java.lang.System.console();for(Object pts:args)if(err)java.lang.System.err.print(pts);else console.writer().print(pts);if(ln)console.writer().println();}static String f(Object format,Object... args){return new java.util.Formatter(java.util.Locale.getDefault()).format(format.toString(),args).toString();}public static void print(Object message,Object... args){p(false,false,f(message,args));}public static void println(Object message,Object... args){p(true,false,f(message,args));}public static void info(Object message,Object... args){p(true,false,f(CYAN+message+RESET,args));}public static void error(Object message,Object... args){p(true,true,f(RED+message+RESET,args));}} |
This file contains 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
#Minecraft server properties | |
server-port=25565 | |
server-ip= | |
query.port=25565 | |
enable-query=true |
This file contains 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
# Config version. Do not change this | |
config-version = "1.0" | |
# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25577. | |
bind = "0.0.0.0:25577" | |
# What should be the MOTD? This gets displayed when the player adds your server to | |
# their server list. Legacy color codes and JSON are accepted. | |
motd = "	add3A Velocity Server" |