Skip to content

Instantly share code, notes, and snippets.

View anthonybaldwin's full-sized avatar
:fishsticks:

Anthony Baldwin anthonybaldwin

:fishsticks:
View GitHub Profile
@anthonybaldwin
anthonybaldwin / 1. screenshot
Last active February 17, 2018 13:09
Screenshot (Linux or Mac) > upload to Google Drive > shorten w/ goog.l, bit.ly, or coinhive > copy to clipboard > notify
#!/bin/bash
#############################################################################################################################
# Title: #
# screenshot (Linux or Mac) > upload to Google Drive > shorten w/ goog.l, bit.ly, or coinhive > copy to clipboard > notify #
#############################################################################################################################
##################################################
# Linux requirements: #
# 1. https://github.com/prasmussen/gdrive #
@anthonybaldwin
anthonybaldwin / __OntraportGoogleAnalyticsEcommerceMinified.js
Last active January 23, 2019 01:59
Send ONTRAPORT Order Form Transaction Information to Google Analytics/Ecommerce
<script>
<!---- CONFIGURATION FOR GOOGLE ANALYTICS ECOMMERCE ----->
var googleAnalyticsId = "UA-123456789-1", // replace with your Google Analytics ID
googleAnalyticsCurrency = "USD"; // currency you wish to send purchases in
<!---- DO NOT EDIT BELOW THIS LINE ----->
function gv(e){for(var a=window.location.search.substring(1).split("&"),r=0;r<a.length;r++){var t=a[r].split("=");if(t[0]==e)return decodeURIComponent(t[1]).replace(/\+/g," ")}return!1}function gae(){var e=gv("OrderId");if(e){ga("require","ecommerce");var a=gv("Revenue"),r=gv("Shipping"),t=gv("Tax");ga("ecommerce:addTransaction",{id:e,revenue:a,shipping:r,tax:t,currency:googleAnalyticsCurrency});var i=1,n=1;do{var c=gv("Item"+n+"Id"),o=gv("Item"+n+"Name"),g=c||o;if(c||o){var u=gv("Item"+n+"Price"),l=gv("Item"+n+"Quantity");ga("ecommerce:addItem",{id:e,name:o,price:u,quantity:l,sku:g}),n++}else i=0}while(i);ga("ecommerce:send"),ga("ecommerce:clear")}return!1}!function(e,a,r,t,i,n,c){e.GoogleAnalyticsObject=i,e[i]=e[i]||function(){(e[i].q=e
@anthonybaldwin
anthonybaldwin / main.js
Last active June 13, 2019 04:56
DLive/TidyLabs stream overlay (requires electron/electron-quick-start)
// git clone https://github.com/electron/electron-quick-start
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
@anthonybaldwin
anthonybaldwin / template.ahk
Created June 23, 2019 01:40
AHK Blank Template by GroggyOtter
;Blank Template written by GroggyOtter
;============================== Start Auto-Execution Section ==============================
; Always run as admin
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
@anthonybaldwin
anthonybaldwin / convert-video.sh
Last active July 13, 2019 04:58 — forked from kus/convert-video.sh
Convert any video (i.e.: AVI, MOV, MP4) to MP4 or WEBM with FFmpeg. Has option to export MP4 with YUV planar color space so it works with QuickTime and Safari.
#!/bin/bash
# Version 1.0 2016-06-03 https://gist.github.com/kus/318f21b840df0b7a6377563ce717c184
# MIT license
# Prerequisites:
# Homebrew: http://brew.sh/
# Install FFmpeg via Homebrew: brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvpx --with-theora --with-libogg --with-libvorbis --with-opus --with-x265
# Make the script executable: sudo chmod u+x convert-video.sh
# Run: ./convert-video.sh
@anthonybaldwin
anthonybaldwin / follower.html
Created July 22, 2019 08:40
WIP: Follower animations using animate.css and Streamlabs Labels
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<script type="text/javascript" src="http://localhost:8888/ticker.js"></script>
<link rel="stylesheet" type="text/css" href="http://localhost:8888/animate.css">
@anthonybaldwin
anthonybaldwin / WIP: Browser Based Text Animations for OBS Studio
Last active July 22, 2019 09:05
Browser Based Text Animations for OBS Studio, Using animate.css and Streamlabs Labels (README @ bottom of Gist)
Shitty README.md:
Inspiration: https://www.reddit.com/r/Twitch/comments/6uqhh9/how_to_use_css_to_format_imported_text/
This started because OBS cannot convert "read from file" text to uppercase/lowercase.
"Issue" is fixed in SLOBS, so is possible...maybe next time I'll dive into OBS and see if a bug, or what.
I have cool animations now, so it was worth it anyway. ;)
I didn't write server.py (found somewhere on StackOverflow researching CORS issue),
or most of ticker.js (this came with original post FTMP).
@anthonybaldwin
anthonybaldwin / update.sh
Created November 12, 2019 02:02
Download most recent Chromedriver and update version file
#!/usr/bin/env bash
# Version
CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
# Remove existing
rm chromedriver
rm chromedriver-mac
rm chromedriver.exe
@anthonybaldwin
anthonybaldwin / ifttt.js
Last active October 28, 2024 02:12
IFTTT Filter for Discord Twitter Webhook
const t12To24 = (time: string): string => { // time=12:30PM
time = time.replace(/[AP]/, " $&"); // time=12:30 PM
let [t, p] = time.split(" "); // t=12:30, p=PM
let [h, m] = t.split(":"); // h=12, m=30
if (h === "12") h = "00"; // h=00
if (p === "PM") h = (parseInt(h, 10) + 12).toString(); // h=12
return `${h}:${m}`; // 12:30
};
@anthonybaldwin
anthonybaldwin / Disable Office Keys.ahk
Created May 28, 2023 03:29
AHK v2 Script to Disable Office/Hyper Key Shortcuts on Windows 11
; Original: https://web.archive.org/web/20230528022520/https://www.howtogeek.com/445318/how-to-remap-the-office-key-on-your-keyboard/
; Converted using: https://github.com/mmikeww/AHK-v2-script-converter
; Registry fix:
; Add: REG ADD HKCU\Software\Classes\ms-officeapp\Shell\Open\Command /t REG_SZ /d rundll32
; Remove: REG DELETE HKCU\Software\Classes\ms-officeapp\Shell
; To use:
; - Run the registry ADD fix above via Administrator PowerShell
; - Run this script on StartUp (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp) by: