Skip to content

Instantly share code, notes, and snippets.

@fwarren
fwarren / withsqlite.py
Last active April 25, 2024 19:47
Simple sqlite3 context manager for Python 3 will type annotations
#!/usr/bin/env python
"""Open Sqlite3 databae with context manager"""
from pathlib import Path
from types import TracebackType
from typing import overload, Any, Optional, Union
class dbopen(): # pylint: disable=invalid-name
"""Simple context manager for sqlite3 databases"""
@in03
in03 / encode_resolve_proxies.py
Last active October 5, 2023 17:08
Encode proxies for DaVinci Resolve using FFMpeg
# Windows: Create a shortcut to a .bat file in 'shell:sendto' to call this script with files passed as arguments
# Use with 'save_proxy_clip_list.py' gist to quickly pull used timeline clips into FFMPEG.
# Use 'link_proxies.py' gist to relink proxies correctly.
# Bug in current Resolve release links clips wrongly to one or two proxies only.
# This assumes FFMPEG is on path.
import os, sys, shutil
import subprocess
import argparse
import pathlib
@jamesramsay
jamesramsay / README.md
Last active April 26, 2024 13:15
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
@zeynepsu
zeynepsu / index.js
Last active March 14, 2018 09:18
Algorithmia NodeJS SDK
/*
* Algorithmia Lambda Sample Code
*/
var AWS = require('aws-sdk');
var apiKey = 'YOUR_API_KEY_HERE'
exports.handler = function (event, context) {
// Specify the target algorithm
var algo = "algo://besirkurtulmus/quadtree_art/0.1.x";
@nikmartin
nikmartin / twiml.gs
Created November 9, 2015 21:38
Google Apps Script to produce Twilio TWIML
function doGet(e) {
var toNum = e.parameter.PhoneNumber;
var fromNum = e.parameter.CallerId;
var action = e.parameter.Direction;
var record = e.parameter.Record;
Logger.log(e);
var output = ContentService.createTextOutput();
var xml = createDialTWIML(fromNum, toNum, action);
@derekmartinla
derekmartinla / account-quality-score-analyzer
Last active January 5, 2022 14:08
Google Adwords Quality Score Performance Analyzer
/**************************************************************************************
* AdWords Optimization -- Quality Score Performance Checker
* This script audits an account's quality score performance and creates a table that shows the
* distribution of CTR, Cost, & Conversins against Quality Score.
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com
**************************************************************************************/
function main() {
@derekmartinla
derekmartinla / google-autocomplete
Last active December 12, 2022 23:16
AdWords Script That Leverges Google Autocomplete
/**********************************************************************************************************************
* Brand Keyword Analysis Google
* Leverages the Google Autocomplete feature to find potential keyword opportunities and negative keywowrds
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
**********************************************************************************************************************/
var hashMapResults = {};
var numOfKeywords = 0;
@derekmartinla
derekmartinla / gist:b719840542406322bb27
Last active June 2, 2017 14:20
AdWords Countdown Ads Updater Script
/***************************************************************************************
* AdWords Countdown Ad Updater -- Find stale countdown ads and replace them with
* Ads that are updated with new dates.
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
****************************************************************************************/
var DESCRIPTION2_TEXT = "Sale Ends In"
@witeshadow
witeshadow / Eng->Ger (Style)
Created February 11, 2015 05:43
German Anki Note Types
.card {
font-family: arial;
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}
[german^="der"] { color: #00f; }
[german^="Der"] { color: #00f; }
@stevebowman
stevebowman / AWSLambdaSimpleSMS.js
Last active June 22, 2023 12:09
AWS Lambda Function to send an SMS message via the Twilio API
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');