Skip to content

Instantly share code, notes, and snippets.

@twilight-sparkle-irl
twilight-sparkle-irl / poll-unlocker.user.js
Last active February 5, 2023 05:46
unlock polls on tumblr (click the Raw button with Tampermonkey installed!)
// ==UserScript==
// @name Poll Unlocker
// @version 0.1
// @description gives u polls
// @author Twilight Sparkle
// @license MIT
// @match https://www.tumblr.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tumblr.com
// @grant none
// @run-at document-start
@AbstractUmbra
AbstractUmbra / 00-deprecation.md
Last active May 2, 2024 02:34
discord.py 2.0+ slash command info and examples

This gist has now been 'deprecated' and has moved...

... to my blog style space for easier contribution by third parties and to provide what I believe to be an easier reading experience. Please field all enquiries and issues to the source repository.

list of useful programs. originally only focused on tools for reverse engineering, asset ripping, etc. but now it's also got some general stuff too

contents

@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active April 24, 2024 09:14
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m

\u001b is the unicode escape for ESCAPE/ESC, meant to be used in the source of your bot (see ). If you wish to send colored text without using your bot you need to copy the character from the website.

function createElementHelper(tagName, {style:{vars:styleVars={}, ...style}={}, attrs={}, events={}, classList=[], children=[], parent=null, insertBefore=null, ...props}={}) {
let elem = document.createElement(tagName);
for(let k in style) elem.style[k] = style[k];
for(let k in styleVars) elem.style.setProperty(k, styleVars[k]);
for(let k in attrs) elem.setAttribute(k, attrs[k]);
for(let k in events) elem.addEventListener(k, events[k]);
if(classList.length > 0) elem.classList.add.apply(elem.classList, classList);
for(let k in props) elem[k] = props[k];
for(let c of children) elem.appendChild(c);
if(parent !== null) {
@Gladuin
Gladuin / tutorial.md
Last active January 19, 2024 11:04
This is a tutorial on how you can backup and restore your Discord favorite gifs (on windows)

This won't work anymore because Discord moved to cloud storage for the gifs

Backup

  1. Open Discord.
  2. Press CTRL, SHIFT and I on your keyboard at the same time.
  3. In the newly opened window, at the top, click the >> button, and then click on Application.
    Image 1
  4. Once in the Application tab, click the little triangle next to Local Storage, and then click on https://discordapp.com.
    Image 2
if(!(Get-Command git -ErrorAction SilentlyContinue)) {
$gitDir = "$env:LOCALAPPDATA\CustomGit"
if(Test-Path $gitDir) { Remove-Item -Path $gitDir -Recurse -Force }
New-Item -Path $gitDir -ItemType Directory
$gitLatestReleaseApi = (Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/git-for-windows/git/releases/latest).Content | ConvertFrom-Json
$mingitObject = $gitLatestReleaseApi.assets `
| Where-Object {$_.name -match "MinGit-[\d.]*?-64-bit.zip"} `
| Select-Object browser_download_url
@uheartbeast
uheartbeast / ChromaticAberration.shader
Created August 27, 2019 14:42
Simple Chromatic Aberration Shader for Godot 3
shader_type canvas_item;
uniform bool apply = true;
uniform float amount = 1.0;
uniform sampler2D offset_texture : hint_white;
void fragment() {
vec4 texture_color = texture(TEXTURE, UV);
vec4 color = texture_color;
@fritschy
fritschy / ffmpeg-one-liners.sh
Last active March 27, 2024 19:15
ffmpeg one-liners
# For all snippets, check documentation for details and settings.
# encode video from a V4L2 device, using specified settings.
# x265 worked somewhat better here and produced less skips (although uses 10x CPU compared to x264)
ffmpeg -f video4linux2 -framerate 30 -input_format mjpeg -video_size 1920x1080 -i /dev/video6 -c:v libx265 -preset ultrafast -c:a none -crf 20 out.mp4
# Convert a raw YUYV422 frame from my USB "microscope" to PNG:
# other valid pixel formats are e.g. rgb24 or yuv420p
ffmpeg -f rawvideo -video_size 2592x1944 -pixel_format yuyv422 -i input_yuyv422_2592x1944.dat -f image2 output.png