This file contains hidden or 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
| # finds songs by names listed in a text file | |
| # and adds them to a spotify playlist | |
| import pprint | |
| import re | |
| import spotipy | |
| from spotipy.oauth2 import SpotifyOAuth | |
| from iteration_utilities import grouper | |
| playlist = ... |
This file contains hidden or 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
| ufw insert 1 deny from 2.59.50.0/24 to any | |
| ufw insert 1 deny from 5.183.130.0/24 to any | |
| ufw insert 1 deny from 31.40.203.0/24 to any | |
| ufw insert 1 deny from 45.11.20.0/23 to any | |
| ufw insert 1 deny from 45.11.20.0/24 to any | |
| ufw insert 1 deny from 45.11.21.0/24 to any | |
| ufw insert 1 deny from 45.15.72.0/23 to any | |
| ufw insert 1 deny from 45.15.72.0/24 to any | |
| ufw insert 1 deny from 45.15.73.0/24 to any | |
| ufw insert 1 deny from 45.15.236.0/23 to any |
This file contains hidden or 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
| put.your.domain.here { | |
| @local { | |
| file | |
| not path / | |
| } | |
| log { | |
| output file /var/log/caddy/mastodon.log | |
| } |
This file contains hidden or 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
| # install sd-webui on CUDA enabled linux distro | |
| export URL_TO_MODEL=https://huggingface.co/....there_are_lots_of_options_here....ckpt | |
| ln -fs /usr/share/zoneinfo/Etc/GMT /etc/localtime | |
| dpkg-reconfigure --frontend noninteractive tzdata | |
| adduser sd --disabled-password --gecos "" | |
| apt update -y | |
| apt install -y software-properties-common | |
| add-apt-repository -y ppa:deadsnakes/ppa | |
| apt update -y |
This file contains hidden or 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
| # notice the cheating technique of selecting all, | |
| # copying to clipboard, then reading the | |
| # clipboard back via JavaScript(!!) | |
| # there's also some stuff to rip content out of | |
| # shadow roots which can be useful if a page | |
| # is doing dynamic rendering | |
| # | |
| # MIT licensed, (c) 2022 Peter Cooper | |
| require 'ferrum' |
This file contains hidden or 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
| # Scan screencast videos for (sensitive) text | |
| # MIT licensed – Copyright (c) 2022 Peter Cooper – @cooperx86 | |
| # Quite a bit of the code comes from | |
| # https://github.com/RhetTbull/osxphotos/blob/master/osxphotos/text_detection.py | |
| # which is itself MIT licensed and copyright (c) 2019-2021 Rhet Turnbull | |
| import tempfile | |
| import subprocess |
This file contains hidden or 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
| source "https://rubygems.org" | |
| gemspec |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'eventmachine' | |
| class FingerServer < EM::Connection | |
| def receive_data(data) | |
| data.strip! | |
| if data =~ /\A\w+\z/ && data.length <= 100 | |
| puts "Got a request for user #{data}" |
This file contains hidden or 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
| mlr --csv filter 'strptime($pushed_at,"%Y-%m-%d %H:%M:%S %Z") > strptime("2021-09-01", "%Y-%m-%d") && $stargazers >= 2' then sort -nr stargazers list.csv > goodlist.csv |
This file contains hidden or 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
| lines = File.readlines("3.txt") | |
| def dl(lines, m) | |
| 12.times do |pos| | |
| rs = lines.map(&:chars).map { |s| s[pos] }.tally | |
| .sort_by { |k, v| [v * m, k.ord * m] } | |
| lines.select! { |l| l[pos] == rs[1][0] } | |
| break lines.first.to_i(2) if lines.size == 1 | |
| end | |
| end |