Skip to content

Instantly share code, notes, and snippets.

const MONTHLY_PAYMENT = 558;
const BORROW_APR = 0.2607;
const REWARD_APR = 0.446;
const TARGET_LTV = 0.3;
const ETH_STAKING_APR = 0.0483;
let collateral = 100000;
let debt = 30000;
let cost = 0;
@apetresc
apetresc / redelegate-cro.sh
Last active March 28, 2023 05:44
A script to automatically claim Crypto.org CRO staking rewards and re-stake them
#!/bin/bash -e
# redelegate-cro.sh is a script that automatically claims all your delegation
# rewards (across any number of validators) in a single transaction (assuming a
# minimum reward threshold is met, to avoid spurious transactions). The rewards
# are then automatically redelegated to the provided validator address, leaving
# behind at least a 0.005 CRO buffer to ensure there is always enough for
# regular transaction fees.
#
# The idea is that it is safe to run this script on a fixed cron schedule and
@garcon
garcon / audio-video-manipulation.md
Last active February 18, 2022 08:04
This is a collection of command line one-liners for manipulating with audio and video files
@bdurrow
bdurrow / merge-mp4.sh
Last active March 8, 2024 05:50 — forked from palaniraja/merge-mp4.sh
Bash script to merge all mp4 videos in current directory (recursively 2 levels). It also updates the chapter marks to retain the folder/filename of source dir
#!/bin/bash
#http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
## Script to merge all mp4 videos in current directory (recursively 2 levels)
## And update chapter marks to retain the folder/filename
## Script for merging videos
@iGlitch
iGlitch / hax.sh
Last active January 13, 2024 16:47
macOS provisioning, hardening, tweaking, whatever script - no more phone home
#!/bin/bash
# Let's "secure" even the script for you :)
sudo -v
function ok() {
echo -e "[OK] "$1
}
function bot() {
@bcdavasconcelos
bcdavasconcelos / DT3 and Zotero.scpt
Last active January 6, 2020 23:40
Still on test phase, so to speak. #Archive
tell application id "DNtp"
set theRecords to the selection
if theRecords is {} then error "Please select some contents."
repeat with theRecord in theRecords
set customMD to custom meta data of theRecord
try
set theBibkey to mdbibkey of customMD
@bcdavasconcelos
bcdavasconcelos / Add Reference Smart Rule for DT3.scpt
Last active March 17, 2020 21:11
Add ABNT Reference Smart Rule for DT3 #DEVONthink3 #Applescript
on performSmartRule(theRecords)
tell application id "DNtp"
try
set these_items to the selection
if these_items is {} then error "Please select some contents."
repeat with this_item in these_items
@felixqueisler
felixqueisler / Minimal 2019.alfredappearance
Created June 11, 2019 12:58
Alfred Theme Minimal 2019
{
"alfredtheme" : {
"result" : {
"textSpacing" : 5,
"subtext" : {
"size" : 10,
"colorSelected" : "#FEFFFEC4",
"font" : "System",
"color" : "#C6C6C665"
},
@andrewp-as-is
andrewp-as-is / cleanup.command
Last active July 19, 2021 07:44
macOS cleanup
#!/usr/bin/env bash
set -- "$@" $(/Library/Desktop\ Pictures -name "*.jpg")
set -- "$@" /Library/Desktop\ Pictures
set -- "$@" /Library/Documentation
set -- "$@" /Library/Logs
set -- "$@" /Library/Modem\ Scripts
set -- "$@" /Library/Screen\ Savers/Default\ Collections
@andrewp-as-is
andrewp-as-is / remove fonts.sh
Last active July 19, 2021 07:44
macOS remove unused fonts
#!/usr/bin/env bash
# System font is San Francisco (SF*)
find /System/Library/Fonts -name "Apple Braille*" -exec sudo rm {} \;
find /System/Library/Fonts -name "AppleSD*" -exec sudo rm {} \;
find /System/Library/Fonts -name "AquaKana*" -exec sudo rm {} \;
find /System/Library/Fonts -name "Arabic*" -exec sudo rm {} \;
find /System/Library/Fonts -name "Avenir*" -exec sudo rm {} \;
find /System/Library/Fonts -name "Geeza*" -exec sudo rm {} \;