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
@duncte123
duncte123 / TwitchIngest.swift
Created December 13, 2022 06:56 — forked from AFathi/TwitchIngest.swift
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/
@duncte123
duncte123 / m3u8-to-mp4.md
Last active June 16, 2021 10:25 — forked from tzmartin/m3u8-to-mp4.md
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
@duncte123
duncte123 / TwemojiParser.java
Created November 9, 2019 19:14 — forked from danfickle/TwemojiParser.java
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;
@duncte123
duncte123 / laravel-queue.service
Created April 9, 2019 08:30 — forked from thomasjsn/laravel-queue.service
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
@duncte123
duncte123 / MarkovChain.java
Created January 30, 2019 14:43 — forked from CalebFenton/MarkovChain.java
Markov Chain implementation
import gnu.trove.map.TCharDoubleMap;
import gnu.trove.map.hash.TCharDoubleHashMap;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
public class MarkovChain implements Serializable {
private static final long serialVersionUID = 986958034001823764L;
@duncte123
duncte123 / MainSandBox.java
Created January 25, 2019 08:17 — forked from asaskevich/MainSandBox.java
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");
@duncte123
duncte123 / simple_xml_encode.php
Last active December 9, 2017 17:38 — forked from paulferrett/simple_xml_encode.php
Super simple class to encode an object into XML.
<?php
class XML {
/**
* Encode an object as XML string
*
* @param Object $obj
* @param string $root_node
* @return string $xml
*/
public static function encodeObj($obj, $root_node = 'response') {