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
# compression level 9, use all cores | |
XZ_OPT='-T$(nproc) -9' | |
# J means xz compression, z means gz | |
NUM_THREADS=$(nproc) | |
sudo env "XZ_OPT=-T${NUM_THREADS} -7" tar -cvpJf /tmp/backup.tar.xz \ | |
--exclude=/tmp/backup.tar.xz \ | |
--exclude=/var/swap.1 \ | |
--exclude=/proc \ | |
--exclude=/mnt \ | |
--exclude=/dev \ |
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
// IMPORTANT IMPORTANT IMPORTANT - SET YOUR TWITTER HANDLE IN THE NEXT LINE! | |
// IMPORTANT IMPORTANT IMPORTANT - SET YOUR TWITTER HANDLE IN THE NEXT LINE! | |
const yourTwitterHandle = "@bootrino"; | |
// one every 10 seconds to avoid Twitter noticing | |
const waitTimeSeconds = 10 | |
const sleep = async (seconds) => new Promise(resolve => setTimeout(resolve, seconds * 1000)); | |
const main = async () => { | |
while (true) { | |
await walkTweets(); | |
await sleep(waitTimeSeconds) |
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
https://www.youtube.com/shorts/jlvwSorkdIo |
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
export const timeSince = (timestamp) => { | |
const seconds = Math.floor((new Date() - new Date(timestamp)) / 1000); | |
let interval = Math.floor(seconds / 31536000); | |
if (interval > 1) { | |
return interval + " years"; | |
} | |
interval = Math.floor(seconds / 2592000); |
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
ffmpeg -i "http://example.com/chunklist.m3u8" -codec copy file.mp4 |
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
def make_slug(text, randomize=False, total_length=None): | |
# arbitrary | |
text = text[:30] | |
# arbitrary | |
length = total_length or 5 | |
if randomize: | |
text += '-' + shortuuid.ShortUUID('abdcefghkmnpqrstuvwxyzABDCEFGHKMNPQRSTUVWXYZ23456789').random(length=length) | |
if total_length: | |
return slugify(text)[:total_length] | |
return slugify(text) |
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
def list_to_path(path_element_list, topslash=False, tailslash=False): | |
# strips leading and trailing slashes from each element and returns without leading and trailing slashes i.e. 'a/b/c' | |
# drop empty list elements | |
path_element_list = [x for x in path_element_list if x] | |
path = '/'.join([x.strip('/') for x in path_element_list]) | |
if topslash: | |
path = '/' + path | |
if tailslash: | |
path = path + '/' |
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
SELECT | |
createdat, | |
REPLACE(CAST (default_renderid AS TEXT), '-', '') as default_renderid, | |
paintbox_name, | |
teamname, | |
description, | |
title | |
FROM render_templates |
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 | |
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu. | |
#See the prefix path and compile options if edits are needed to suit your needs. | |
# ripped from https://gist.github.com/Brainiarc7/3f7695ac2a0905b05c5b | |
# updated to my personal needs | |
# tested on Ubuntu 22 | |
# refer here: |
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
refer here: | |
https://www.bennadel.com/blog/3590-you-can-safely-apply-object-spread-to-null-and-undefined-values-in-typescript-3-2-4.htm | |
NewerOlder