Skip to content

Instantly share code, notes, and snippets.

View TeamDman's full-sized avatar
🌜
o/

TeamDman

🌜
o/
View GitHub Profile
@silver-xu
silver-xu / ts-boilerplate.md
Last active May 3, 2024 14:01
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@bennydictor
bennydictor / BrainFuckMethodHandleCompiler.java
Created April 25, 2019 12:13
BrainFuck interpreter/jit compiler using java's MethodHandle
package org.bennydict.brainmethodfuckhandles;
import java.io.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.HashMap;
import java.util.Scanner;
public class BrainFuckMethodHandleCompiler {
@neilpeterson
neilpeterson / init-backend-results.md
Last active November 17, 2022 21:13
Initializing Terraform Backend

When initalizing a Terraform backend, a .terraform/terraform.tfstate file is written to disk and can include storage account secrets.

Option 1

Include the Azure Storage key in the Terraform configuration.

Not ideal: the Storage access key is exposed both in the configuration and in the .terraform/terraform.tfstate file.

Configuration:

@Gydo194
Gydo194 / Server.cpp
Last active July 7, 2023 16:39
C++ Event driven TCP socket server (multi client, single threaded)
/*
* Server.cpp
*
* EventServer is a simple C++ TCP socket server implementation,
* to serve as an example to anyone who wants to learn it.
* It can interface with the rest of your program using three callback functions.
* - onConnect, which fires when a new client connects. the client's fd is passed.
* - onDisconnect, which fires when a client disconnects. passes fd.
* - onInput, fires when input is received from a client. passes fd and char*
*
@wwerner
wwerner / Dockerfile
Last active December 22, 2023 10:48
Enable heroku ps:exec in docker containers
FROM openjdk:8-jdk-alpine
VOLUME /tmp
# see https://devcenter.heroku.com/articles/exec#enabling-docker-support
RUN apk add --no-cache curl bash openssh python
ADD src/main/docker/heroku-exec.sh /app/.profile.d/heroku-exec.sh
RUN chmod a+x /app/.profile.d/heroku-exec.sh
ADD src/main/docker/sh-wrapper.sh /bin/sh-wrapper.sh
RUN chmod a+x /bin/sh-wrapper.sh
@unitycoder
unitycoder / 0-win10-live-stream-server.txt
Last active April 16, 2022 11:26
Setting up Live Video Stream Server on Windows 10 (RTPM + HLS + OBS)
from http://zqdevres.qiniucdn.com/data/20170907091103/index.html
- download ngingx with RTPM module http://nginx-win.ecsds.eu/download/ *nginx 1.7.12.1 Lizard.zip
- unzip
- create start.bat script
@echo off
title Start Stream
cd /d "C:\nginx"
start nginx
exit
@oliveratgithub
oliveratgithub / emojis.json
Last active April 26, 2024 22:35
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z
@primaryobjects
primaryobjects / m3u8.md
Last active May 3, 2024 02:44
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@Faheetah
Faheetah / Dockerfile
Last active October 19, 2022 15:22
Docker patterns/anti-patterns
### Generic Dockerfile demonstrating good practices
### Imports
# Bad-ish, we do not need Ubuntu for this, nor do we want latest if we are using in a build system, predictable is better
FROM ubuntu:latest
# Better, using a small image since our app has no dependency on Ubuntu
FROM alpine:3.3