Skip to content

Instantly share code, notes, and snippets.

@Richienb
Richienb / script.gs
Created January 27, 2019 13:42
Load external JavaScript libraries in Google Script
// Load JS from HTML file
eval(HtmlService.createTemplateFromFile("<SCRIPT>").getRawContent())
// Load JS from URL
eval(UrlFetchApp.fetch("<SCRIPT>").getContentText())
// Load JS from Google Drive
eval(DriveApp.getFileById("<SCRIPT>").getBlob().getDataAsString())
// Load JS from URL into global namespace
@Richienb
Richienb / RemoveBranding.css
Last active April 13, 2024 17:00
Remove 000Webhost Branding For Wordpress CSS Code
img[src*="https://cdn.000webhost.com/000webhost/logo/footer-powered-by-000webhost-white2.png"] {display: none;}
@Richienb
Richienb / umd.common.js
Created March 17, 2019 11:18
UMD Example
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory();
} else {
root.returnExports = factory();
}
}(typeof self !== 'undefined' ? self : this, function () {
@Richienb
Richienb / README.md
Last active September 19, 2023 14:12
Google Translate Widget CDN

Google Translate Widget CDN

@Richienb
Richienb / DownloadFile.vbs
Last active August 9, 2023 08:03
Download A File In Visual Basic Script (vbs)
Sub HTTPDownload( myURL, myPath )
Dim i, objFile, objFSO, objHTTP, strFile, strMsg
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
If objFSO.FolderExists( myPath ) Then
strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) )
ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then
strFile = myPath
Else
WScript.Echo "ERROR: Target folder not found."
@Richienb
Richienb / Data Waster.bat
Last active January 14, 2023 21:07
Automatic Data Waster
@echo off
title Data Waster
cls
echo Welcome to data waster!
echo.
echo Generating random file name...
:rand
@Richienb
Richienb / index.user.js
Last active September 1, 2022 11:21
I'm not a Fortnite player
// ==UserScript==
// @name I'm not a Fortnite player
// @namespace https://github.com/Richienb
// @version 0.1
// @description Change ReCAPTCHA and hCaptcha labels to be something more epic
// @author Richie Bendall
// @match *://www.google.com/recaptcha/api2/anchor*
// @match *://newassets.hcaptcha.com/captcha/v1/*/static/hcaptcha-checkbox.html*
// @grant none
// ==/UserScript==
@Richienb
Richienb / index.js
Last active November 18, 2021 15:11
Wrap words
const string = ``;
const wrapWords = (string, width) => string.replace(new RegExp(`(?![^\\n]{1,${width}}$)([^\\n]{1,${width}})\\s`, 'g'), '$1\n');
console.log(string.split('\n').map(value => wrapWords(value, 80)).join('\n\n'));
function split(array, groups = 2) {
array = array.sort((a, b) => b - a);
const parts = Array.from({length: groups}, () => []);
const partLengths = Array.from({length: groups}, () => 0);
for (const item of array) {
const partIndex = partLengths.indexOf(Math.min(...partLengths));
parts[partIndex].push(item);
partLengths[partIndex] += item;
@Richienb
Richienb / Large File Creation Tool.bat
Created June 10, 2018 02:05
Large File Creation Tool In A Batch File
@echo off
title Large File Creation Tool
cls
echo If this tool doesn't seem to work, ensure you are running it in elavated/administrator mode
echo Press any key to continue
pause>nul
echo.