Skip to content

Instantly share code, notes, and snippets.

View tonidy's full-sized avatar

toni dy tonidy

View GitHub Profile
alias nvim-lazy="NVIM_APPNAME=LazyVim nvim"
alias nvim-chad="NVIM_APPNAME=NvChad nvim"
alias nvim-astro="NVIM_APPNAME=AstroNvim nvim"
function nvims() {
items=("default" "LazyVim" "NvChad" "AstroNvim")
config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config  " --height=~50% --layout=reverse --border --exit-0)
if [[ -z $config ]]; then
echo "Nothing selected"
return 0
@gekigek99
gekigek99 / cpu usage percent.go
Last active September 1, 2024 12:35
calculate the average cpu usage percent of the last second of a given pid
// This script calculates the average cpu usage percent of the last second (of a given pid, in this case the script itself).
// (*process.Process).CPUPercent() from "github.com/shirou/gopsutil/process" returns the average cpu usage percent since the process was started.
// If you call cpuPercent(p) every 10 seconds then the average cpu usage percent of the last 10 seconds is returned.
//
// cpuPercent first call returns the average cpu percent usage since the start of the process.
//
// Remember that if the process you are analyzing changes pid you have to update `pTracker` with the new pid (+new info) and remove the old pid.
// (not the case for this example though)
package main
@Stroniax
Stroniax / SingleCollectionBenchmark.cs
Created February 16, 2023 19:45
SingleCollection Benchmark
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace SingleCollectionBenchmark;
/// <summary>
/// <code>
@TameemS
TameemS / debloatLDPlayer.md
Last active June 15, 2025 05:38
Debloating LDPlayer

Inspired by this

More of my guides: Debloating MEMu - Debloating Nox (Updated)

This mainly applies to LDPlayer9. They will probably work on the low end options (like LDPlayer5) but not guaranteed.

Debloating LDPlayer

This emulator seems to have less stability issues than MEMu. I think we get the shtick that these emulators do spooky stuff.

  1. Download LDPlayer, preferably an offline version from the version history
@devinschumacher
devinschumacher / cloud-gpus.md
Last active June 23, 2025 03:08
Cloud GPU Hosting // The Best Servers, Services & Providers [RANKED!]
title tags
The Best Cloud GPU Providers for Artificial Intelligence & Machine Learning
cloud gpu providers
cloud gpu
artificial intelligence

Cloud GPUs: Servers, Providers & Everything You Would Ever Need

@pudquick
pudquick / brew.md
Last active May 5, 2025 21:30
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@shawnli87
shawnli87 / download_gofile.sh
Last active February 12, 2025 11:55 — forked from MCOfficer/README.md
Bash script to download files from gofile.io
#!/bin/bash
url="$1"
#prompt for url if not provided
until [ ! -z "$url" ] ; do
read -p "url=" url
done
id=$(sed 's|.*gofile.io/d/||g' <<< "$url")
@leiless
leiless / ipv4_ipv6_doh_doq.md
Last active June 20, 2025 08:33
List of direct IPv4/IPv6 DoH/DoQ

dns.google / 8888.google

8.8.4.4
8.8.8.8
2001:4860:4860:0:0:0:0:64
2001:4860:4860:0:0:0:0:6464
2001:4860:4860:0:0:0:0:8844
2001:4860:4860:0:0:0:0:8888
@tonidy
tonidy / ISODate.go
Created May 11, 2022 23:05 — forked from lokeb/ISODate.go
Custom Date type with format YYYY-MM-DD and JSON decoder (Parser) and encoder (Unmarshal and Marshal methods)
//ISODate struct
type ISODate struct {
Format string
time.Time
}
//UnmarshalJSON ISODate method
func (Date *ISODate) UnmarshalJSON(b []byte) error {
var s string
if err := json.Unmarshal(b, &s); err != nil {
@mwouts
mwouts / _introducing_itables.md
Last active February 21, 2025 15:06
Pandas DataFrames as interactive HTML DataTables

Pandas DataFrames as interactive HTML DataTables

In Jupyter Notebook, Jupyter Lab, Google Colab, VS Code and PyCharm

Pandas DataFrames are central to Data Analysis in Python. In this post, we introduce the itables Python package that enhances how these DataFrames are displayed, by turning them into interactive HTML DataTables.


Using itables is as simple as