Skip to content

Instantly share code, notes, and snippets.

@Fraasi
Fraasi / soaper-dl.sh
Created March 31, 2024 14:41
Failed pr to KevCui/soaper-dl, which I like to keep around
#!/usr/bin/env bash
#
# Download TV series and Movies from Soaper using CLI
#
#/ Usage:
#/ ./soaper-dl.sh [-n <name>] [-p <path>] [-e <num1,num2,num3-num4...>] [-l] [-s] [-d]
#/
#/ Options:
#/ -n <name> TV series or Movie name
#/ -p <path> media path, e.g: /tv_XXXXXXXX.html
@Fraasi
Fraasi / git-bash-symlink.sh
Created December 7, 2022 11:49
my old git-bash symlink function from my dotfiles install.sh
@Fraasi
Fraasi / cal.py
Last active August 4, 2022 15:46
Simple (unix like) command line calendar in python
#!/usr/bin/env python
"""Simple (unix like) command line calendar in python"""
import os
from datetime import datetime
import argparse
import calendar
@Fraasi
Fraasi / npm-update-all
Last active November 28, 2021 12:33
small bash script to print out command to update all (dev)dependencies from package.json to @latest
#!/bin/bash
USAGE="Usage:
npm-update-all
-> prints all dependencies
-d
-> prints all devDependencies
from current dirs package.json
@Fraasi
Fraasi / wttr.sh
Last active January 5, 2023 23:51
simple wrapper function around http://wttr.io to get sensible defaults
#!/usr/bin/env bash
# simple wrapper function around http://wttr.io to get sensible defaults
# easily modified by changing the defaults and/or last parameters in the url
function wttr() {
USAGE="
Usage: wttr [OPTIONS]
Options:
-c <city> city name, double words with +, eg. new+york
@Fraasi
Fraasi / cowsay-random-quote.sh
Created October 26, 2019 15:05
Curl random quote and pass it to cowsay
#!/bin/bash
declare -a MODES
MODES=("b" "d" "g" "p" "s" "t" "w" "y")
declare -a COWS
COWS=("tableflip" "aperture-blank" "beavis.zen" "bees" "biohazard" "box" "broken-heart" "cat" "cat2" "clippy" "cowfee" "cube" "default" "dragon" "hedgehog" "kilroy" "kosh" "nyan" "owl" "psychiatrichelp" "psychiatrichelp2" "shrug" "squirrel" "tux")
MODES_LENGTH=${#MODES[@]}
MODES_INDEX=$(($RANDOM % $MODES_LENGTH))
@Fraasi
Fraasi / checkChallenges.js
Created May 12, 2019 18:37
Little node script to check what coding train challenges have been ported to P5/Processing.
const path = require('path')
const fs = require('fs')
let folderCount = 0
let stdoutWidth = process.stdout.columns - 9
let startTime
const results = {}
function checkChallenges(startDir) {
startTime = new Date()
@Fraasi
Fraasi / github-repo-created-at-bookmarklet.js
Created February 18, 2019 11:21
Bookmarklet to get github repository creation time.
(function () {
if (window.location.host !== 'github.com') {
alert('Not a GitHub page.');
return;
}
if (window.location.pathname.split('/').length < 3) {
alert('Not in a repository page.');
return;
}
function formatBytes(a, b) { if (0 == a) return "0 Bytes"; var c = 1024, d = b || 2, e = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], f = Math.floor(Math.log(a) / Math.log(c)); return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f] }
@Fraasi
Fraasi / resize-window.js
Created January 26, 2019 22:27
Resize browser/electron/extension window based on content
function resizeWindow() {
const padding = 20 // title bar height without menu in electron
const heightDiff = (document.body.clientHeight - document.documentElement.clientHeight) + padding
window.resizeBy(0, heightDiff)
}
@Fraasi
Fraasi / get-iframe-links.js
Last active April 26, 2019 14:02
Devtools snippet to easily get video links in certain video sites to copy paste to youtube-dl.