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 April 4, 2024 04:52 — 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 February 27, 2025 04:29
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"
},
@andrewpetrochenkov
andrewpetrochenkov / Time Machine exclusions.command
Last active August 23, 2024 02:15
macOS Time Machine exclusions
#!/usr/bin/env bash
{ set +x; } 2>/dev/null
IFS=$'\n'
set "$@" $(find ~ -name ".*" ! -name ".CFUserTextEncoding" ! -type l -mindepth 1 -maxdepth 1) # dotfiles
set "$@" $(find ~ -name "Google *" -mindepth 1 -maxdepth 1) # Google Drive
set "$@" ~/git # store on github/etc :)
set "$@" ~/node_modules
set "$@" ~/Applications # install apps with brew cask
@andrewpetrochenkov
andrewpetrochenkov / mac-register-app.sh
Last active August 3, 2024 15:52
macOS lsregister app
set ~/Applications/name.app
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f "$@"