Skip to content

Instantly share code, notes, and snippets.

View ajtatum's full-sized avatar

AJ Tatum ajtatum

View GitHub Profile
@ajtatum
ajtatum / DirectMuxVideoBlobTrigger.cs
Created June 16, 2023 12:56
Upload to Mux API via Azure Function with Blob Trigger
using System;
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Text.Json.Serialization;
namespace AJTDigital.Mux
@ajtatum
ajtatum / country-helper.js
Created August 30, 2021 02:27
JavaScript Country Name To Code and Code To Country Name Functions
var countryNameToCode = {
'Afghanistan': 'AF',
'Aland Islands': 'AX',
'Albania': 'AL',
'Algeria': 'DZ',
'American Samoa': 'AS',
'Andorra': 'AD',
'Angola': 'AO',
'Anguilla': 'AI',
'Antarctica': 'AQ',
@agustinustheo
agustinustheo / add-nginx-conf.sh
Created December 8, 2020 18:35
A shell script to add NGINX configurations automatically.
#!/bin/bash
conf_path="/etc/nginx/conf.d/$1.conf"
if [ -f "$conf_path" ]
then
conf_text=`cat $conf_path`
if [[ "$conf_text" == *"$2"* ]] || [[ "$conf_text" == *"localhost:$3"* ]]
then
echo "Proxy route or localhost port has been used, please manually reconfigure your Nginx configuration."
else
@aaronsteers
aaronsteers / Choco-One-Click.js
Last active April 17, 2022 01:11
Choco install script for TamperMonkey/GreaseMonkey
// ==UserScript==
// @name Choco-One-Click
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description Install software from chocolatey.org with one-click. This requires choco:// protocol support (choco install choco-protocol-support).
// @author AJ Steers
// @include http://*chocolatey.org/*
// @include https://*chocolatey.org/*
// @grant none
// ==/UserScript==
@futtta
futtta / autoptimize_defer_inline_jquery.php
Last active November 11, 2022 21:43
POC to defer inline JS that requires jQuery
<?php
add_action('plugins_loaded','ao_defer_inline_init');
function ao_defer_inline_init() {
if ( get_option('autoptimize_js_include_inline') != 'on' ) {
add_filter('autoptimize_html_after_minify','ao_defer_inline_jquery',10,1);
}
}
function ao_defer_inline_jquery( $in ) {
@ajtatum
ajtatum / cloudSettings
Last active August 30, 2021 02:26
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-08-30T02:26:20.541Z","extensionVersion":"v3.4.3"}
@webkul
webkul / docker-db-container-backup.sh
Last active February 15, 2024 21:02
Bash script to take backup of all the databases of docker database container from the host.
#!/bin/bash
set -x
## Mention your database container name
container_name=
## Mention your mysql root password
mysql_root_password=
DATE=`date +%F-%H-%M-%S`
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 25, 2024 03:58 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 16, 2024 22:32
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