Skip to content

Instantly share code, notes, and snippets.

View brainfever's full-sized avatar

Jon Kniss brainfever

  • 01:47 (UTC -12:00)
View GitHub Profile
@brainfever
brainfever / index.html
Created June 7, 2023 00:57 — forked from looselytyped/index.html
Containers in 3 weeks — Week 1 (nginx test file)
<!DOCTYPE html>
<html lang="en">
<head>
<!-- BLATANTLY STOLEN FROM https://getbootstrap.com/docs/4.1/examples/cover/ -->
<title>Docker Workshop</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
/*
@brainfever
brainfever / Setup.md
Created June 7, 2023 00:56 — forked from looselytyped/Setup.md
Containers in 3 weeks - Set up

Containers in 3 weeks — Week 1/2 setup

Installation

You will need Docker installed! Here is a link to get you started. Proceed after you are done installing.

Warm up your engines!

@brainfever
brainfever / ExportKindle.js
Created October 10, 2022 03:41 — forked from jkubecki/ExportKindle.js
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
// Set header for CSV export line - change this if you change the fields used
var csvData = "ASIN,Title,Authors,PurchaseDate\n";
db.transaction(function(tx) {
"Pester - Describe block (Unit Test, Exported Function)": {
"prefix": "descu",
"body": [
"describe '${name}' {",
"",
"\t$$commandName = '${name}'",
"",
"\tcontext 'Help' {",
"\t\t",
@brainfever
brainfever / imageToText.gs
Created February 27, 2021 20:17 — forked from tagplus5/imageToText.gs
google apps script image to text ocr
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};
@brainfever
brainfever / Apps Script pdfToText utility.md
Created February 27, 2021 20:16 — forked from mogsdad/Apps Script pdfToText utility.md
For http://stackoverflow.com/questions/26613809, a question about getting pdf attachments in gmail as text. I got a little carried away - this does much more than asked.

Google Apps Script pdfToText Utility#

This is a helper function that will convert a given PDF file blob into text, as well as offering options to save the original PDF, intermediate Google Doc, and/or final plain text files. Additionally, the language used for Optical Character Recognition (OCR) may be specified, defaulting to 'en' (English).

Note: Updated 12 May 2015 due to deprecation of DocsList. Thanks to Bruce McPherson for the getDriveFolderFromPath() utility.

    // Start with a Blob object
    var blob = gmailAttchment.getAs(MimeType.PDF);
    
@brainfever
brainfever / appsScript_ListFilesFolders_ver.2.js
Created February 27, 2021 20:12 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software