Skip to content

Instantly share code, notes, and snippets.

@oliv-j
oliv-j / mdtrack.php
Last active February 23, 2023 15:13
Medication reminder web service: a rest request for iOS medication tracker shortcut/automation - the shortcut can then be integrated with Pushover for alerts to any device.
//will retrieve the status from file and return it as json to the client
<?php
$filename = "mdstatus.txt";
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
//get the file
// Open the file
$fp = @fopen($filename, 'r');
// extract each line to an array
@oliv-j
oliv-j / DomainLookup.gs
Created February 23, 2023 15:00
Google Sheets AppScript to query Clearbit data augmentation API and return either a company name or the company domain name
//pass text from a cell (e.g. A1) to call the function by entering the following in to a cell '=getDomain(A1)'
//The result, when obtained, will then be seen in the cell (A1, in this example).
//requires a free Clearbit account and your api token, which you need to enter below by replacing 'YOUR_TOKEN_HERE'
function getDomain(domain) {
var url = "https://company.clearbit.com/v1/domains/find?name="+domain;
var options = {
"headers" : {
Authorization:"Bearer YOUR_TOKEN_HERE"
}
@oliv-j
oliv-j / TouchPad.php
Last active February 23, 2023 15:37
A web service to run in combination with Better Touch Tool (BTT) to create an Elgato Streamdeck like experience with any Touch Screen device (like an old iPad!)
//run this on a server to output the UI for a client
//references config from touchpad.json and images from an adjacent img folder
//you need to add the local ip of the machine you are trying to control via BTT.
//This will then be stored in a cookie so that you don't have to add it each time.
//A later version will have a proper implementation of tabs so that you can switch
to different sets of icons to trigger functions in BTT.
<html>
<head>
<style>
@oliv-j
oliv-j / gist:61ff4d0f3329b60d7f5169f18451e366
Created June 7, 2023 09:00
Google App Script - Time Stamp for Google Sheets
// this will check a range, and if cell is in range, then
//add a time stamp to the top of the column wherein the change was made.
function onEdit(e)
{
var editRange = { // B4:J6
top : 9,
bottom : 255,
left : 2,
right : 7