Skip to content

Instantly share code, notes, and snippets.

View danferns's full-sized avatar

Daniel Fernandes danferns

View GitHub Profile
@danferns
danferns / make-pdf.bat
Last active February 16, 2022 14:22
Compiles all images in the current directory into a PDF file, then archives the images using 7zip.
img2pdf --output %1.pdf *.jpg
7z a -mx9 %1.zip *.jpg
del *.jpg
exit
@danferns
danferns / Google Form to Discord Webhook.gs
Created February 11, 2022 06:16
Google Apps Script to forward form responses straight into your Discord server
const POST_URL = "INSERT DISCORD WEBHOOK URL HERE";
// aliases allow you to use alternative titles in the webhook
// for example, in the form the title may be "Your Name"
// you can change it to just "Name" in the webhook by setting an alias for that field.
// you will need to find the field's ID (the numbers) for that
const ALIASES = {
123456789: "Email Address",
789102112: "Name",
@danferns
danferns / Google Auto Log-in Userscript.js
Last active November 20, 2022 09:47
TamperMonkey script to automatically log in to your Google Account
// ==UserScript==
// @name Google Auto Log-in
// @author Danny
// @match https://accounts.google.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// ==/UserScript==
(function () {
"use strict";
@danferns
danferns / tasks.json
Created January 15, 2022 15:17
VS Code: Run command on folderOpen
{
"version": "2.0.0",
"tasks": [
{
"label": "Watch Changes", // Name of task
"type": "shell",
"command": "npm run watch", // Enter your command here
"group": "none",
"presentation": {
"reveal": "silent",
@danferns
danferns / shrinkvideo.js
Last active October 31, 2021 12:16
Shrink video files using node.js and ffmpeg
/* Shrink MP4 files using node.js and ffmpeg
*
* (c) 2021 Daniel Fernandes. This code is licensed under the MIT license.
*
* This script takes any video files from an "input folder", and exports a
* lower bit-rate version of the video to an "output folder".
*
* Make sure you have Node.js and ffmpeg installed!
*
* My hope is to eventually make this work cross-platform. I believe it