Skip to content

Instantly share code, notes, and snippets.

View theoparis's full-sized avatar

Theo Paris theoparis

View GitHub Profile
@EvieePy
EvieePy / music.py
Last active April 3, 2025 19:21
Basic music with playlist support on Rewrite
"""
Please understand Music bots are complex, and that even this basic example can be daunting to a beginner.
For this reason it's highly advised you familiarize yourself with discord.py, python and asyncio, BEFORE
you attempt to write a music bot.
This example makes use of: Python 3.6
For a more basic voice example please read:
https://github.com/Rapptz/discord.py/blob/rewrite/examples/basic_voice.py
@sebnyberg
sebnyberg / install_sharenix.sh
Created October 17, 2017 17:10
Install Sharenix on Ubuntu
# Bash script for installing Sharenix
rm -rf sharenix*
sudo rm /bin/sharenix*
rm ~/.sharenix.json
echo Downloading Sharenix...
wget https://github.com/Francesco149/sharenix/releases/download/0.6.5a/sharenix-x86_64.tar.xz >/dev/null 2>&1
wget https://raw.githubusercontent.com/Francesco149/sharenix/master/sharenix-section >/dev/null 2>&1
@duckythescientist
duckythescientist / tqdm_longrun.py
Created October 9, 2017 14:18
Tqdm wrapper and decorator to give a long-running function a progress bar
#/usr/bin/env python3
import time
import threading
import functools
import tqdm
def long_running_function(*args, **kwargs):
@rickyzhang82
rickyzhang82 / keycode.linux
Created September 15, 2017 22:11
Key code for Linux
# /usr/share/BasiliskII/keycodes
#
# Basilisk II (C) 1997-2005 Christian Bauer
#
# This file is used to translate the (server-specific) scancodes to
# Mac keycodes depending on the window server being used.
#
# The format of this file is as follows:
#
# sdl <driver string>
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@colebob9
colebob9 / InstallQEMUOnMac.sh
Last active May 1, 2020 12:10
Installs QEMU on a Mac, doesn't need admin
# InstallQEMUOnMac v1
# colebob9
# Installs QEMU using homebrew and downloads Ubuntu on a Mac
# Execute `chmod +x InstallQEMUOnMac.sh` before using.
echo "This will install QEMU on your Mac. Please note that this will take about 40 minutes to get through. Go watch some YouTube videos or something cause you're going to be here for a while. This script will take care of everything."
echo "Please make sure you have your charger plugged in, and a lot of patience."
echo "Do not *at any point* exit out of this Terminal window, even if it looks stuck. It's not."
echo "It is also recommended to have the Mac apps \"Amphetamine\" or \"Caffeine\" installed and enabled now, so your Mac doesn't sleep. Do not close your lid either."
@matti
matti / add.sh
Created July 29, 2017 11:12
alpine docker add package from edge testing
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
x11vnc
@JBlond
JBlond / bash-colors.md
Last active April 19, 2025 20:25 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@SKempin
SKempin / Git Subtree basics.md
Last active April 17, 2025 12:13
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this: