Skip to content

Instantly share code, notes, and snippets.

View duncte123's full-sized avatar
:fishsticks:
yummy fishticks

Duncan Sterken duncte123

:fishsticks:
yummy fishticks
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 20, 2024 15:48
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@asaskevich
asaskevich / MainSandBox.java
Created July 26, 2014 10:07
Java Reflection - Remove "private final" modifiers and set/get value to field
package sandbox;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
public class MainSandBox {
public static void main(String[] args) throws Exception {
Example ex = new Example();
// Change private modifier to public
Field f = ex.getClass().getDeclaredField("id");
@thomasjsn
thomasjsn / laravel-queue.service
Last active April 26, 2024 09:34
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@PimDeWitte
PimDeWitte / Efficient Bad Word Filter
Last active February 11, 2024 14:57
Simple profanity filter written in Java for efficient comparison. Runtime grows based on string input, not list size.
static Map<String, String[]> words = new HashMap<>();
static int largestWordLength = 0;
public static void loadConfigs() {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new URL("https://docs.google.com/spreadsheets/d/1hIEi2YG3ydav1E06Bzf2mQbGZ12kh2fe4ISgLg_UBuM/export?format=csv").openConnection().getInputStream()));
String line = "";
int counter = 0;
while((line = reader.readLine()) != null) {
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active July 19, 2024 13:51
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@AFathi
AFathi / TwitchIngest.swift
Created May 13, 2018 00:46
A simple Swift enum that contains Twitch RTMP addresses in different cities
//
// TwitchIngest.swift
//
//
// Created by Ahmed Bekhit on 5/12/18.
// Copyright © 2018 Ahmed Bekhit. All rights reserved.
//
// MARK:- Source: https://stream.twitch.tv/ingests/
@coreycoburn
coreycoburn / DynamicComponent.vue
Last active October 26, 2022 08:54
Dynamically load Vue components
<template>
<div>
<component :is="dynamicComponent"/>
</div>
<template>
<script>
export default {
props: {
componentName: {
@danfickle
danfickle / TwemojiParser.java
Created August 20, 2019 00:44
Twemoji parser for Java 8 using trie (replaces emoji with img tags).
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ghostrider-05
ghostrider-05 / discord_app_protocols.md
Last active July 20, 2024 13:35
An unofficial list of discord app protocol routes

Discord app protocol routes

Home:

  • /: discord://-/
  • friends: discord://-/channels/@me/
  • nitro: discord://-/store
  • shop: discord://-/shop
  • message requests: discord://-/message-requests
  • family centre: discord://-/family-center