Skip to content

Instantly share code, notes, and snippets.

@sadedv
sadedv / fastJava.java
Created March 4, 2016 13:25
Java Template (Fast I/O)
import java.util.*;
import java.io.*;
class
{
/************************ SOLUTION STARTS HERE ************************/
private static void solve(FastScanner s1, PrintWriter out){
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2024 10:19
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@victornpb
victornpb / deleteDiscordMessages.js
Last active July 9, 2024 07:46
Delete all your messages from DM or Channel in Discord
/*
This file is now hosted here:
https://github.com/victornpb/undiscord
*/
@dev-hydrogen
dev-hydrogen / Easing.java
Last active March 24, 2024 19:48
Various Easings in java
import java.util.function.Function;
import static java.lang.Math.*;
// https://easings.net/
// https://gist.github.com/dev-hydrogen/21a66f83f0386123e0c0acf107254843
public enum Easing {
easeInSine(x -> 1 - cos(x * PI) / 2),
easeOutSine(x -> sin(x * PI) / 2),
easeInOutSine(x -> -(cos(PI * x) - 1) / 2),
@tryashtar
tryashtar / fonts.md
Last active May 10, 2024 06:26
Characters with special consideration in Minecraft fonts

The following characters have special behavior in Minecraft, and care should be taken when retexturing them in a custom font:

Unusable

  • \u0000: NULL �
    • This character cannot be included in a bitmap font, since it's used as a placeholder to skip certain cells of the texture grid.
  • \u000a: LINE FEED ⏎
    • This character can be retextured and appear in text that does not support multiple lines. In chat, it will be invisible and cause a line break.
  • \u0025: PERCENT SIGN %
    • This character is used for text insertions when using translate and with, so it could be unexpectedly replaced if used unintentionally.
  • \u00a7: SECTION SIGN §
@foxy4096
foxy4096 / main.css
Last active December 12, 2023 11:40
Snippets
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css");
.emojione {
width: 30px;
padding-left: 6px;
display: inline-flex;
vertical-align: text-top;
}
.tabbed-set {
@gd3kr
gd3kr / script.js
Created February 15, 2024 06:30
Download a JSON List of twitter bookmarks
/*
the twitter api is stupid. it is stupid and bad and expensive. hence, this.
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes.
When finished, it downloads a JSON file containing the raw text content of every bookmark.
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please?
*/
@stenuto
stenuto / convert.sh
Created May 29, 2024 03:45
Convert video file into HLS playlist with multiple resolutions and bitrates
#!/bin/bash
# This script takes a video file as input and converts it into an HLS (HTTP Live Streaming) playlist with multiple resolutions and bitrates. It also generates a thumbnail image from the video.
# Check if an input filename is provided
if [ -z "$1" ]; then
echo "Usage: $0 input_filename (without extension) [-t]"
exit 1
fi