Skip to content

Instantly share code, notes, and snippets.

View getMBP's full-sized avatar

Codexavion getMBP

  • Pennsylvania
View GitHub Profile
@getMBP
getMBP / .js
Created September 14, 2022 20:28
finds word within file
//SEARCHES THE "document.body" for a TEXT_NODE that matches the string "book" and returns true if it does and false if it doesnt.
function talksAbout( node, string ) {
if ( node.nodeType == document.ELEMENT_NODE ) {
for ( var i = 0; i < node.childNodes.length; i++ ) {
if ( talksAbout( node.childNodes[ i ], string ) )
return true;
}
return false;
} else if ( node.nodeType == document.TEXT_NODE ) {
return node.nodeValue.indexOf( string ) > -1;
@getMBP
getMBP / gist:916a9177582aa84263e7fd594d38f1cf
Created March 31, 2019 03:32 — forked from mhawksey/gist:1170597
Google Apps Script to fill in a Document template with Spreadsheet data
function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user
@getMBP
getMBP / index.html
Created July 21, 2018 11:36
MINIMALISTIC FORM
<header>MINIMALISTIC FORM</header>
<form id="form" class="topBefore">
<input id="name" type="text" placeholder="NAME">
<input id="email" type="text" placeholder="E-MAIL">
<textarea id="message" type="text" placeholder="MESSAGE"></textarea>
<input id="submit" type="submit" value="GO!">
</form>