Skip to content

Instantly share code, notes, and snippets.

View rogerthomas84's full-sized avatar

Roger Thomas rogerthomas84

View GitHub Profile
@rogerthomas84
rogerthomas84 / console.js
Created July 11, 2024 11:55
Save all skipped creations in Google Photos
// You should be using the web app for this. Open developer tools, navigate to console, and paste this.
// Then press enter. It'll take a while! If you've got many unsaved creations, I'd suggest doing a page at a time
// by not scrolling down the page too far.
let spanSave = document.querySelectorAll('span');
spanSave.forEach(function(span){
if(span.textContent === 'Save'){
let parentButton = span.parentElement;
parentButton.click();
span.style.color = 'red';
}
@rogerthomas84
rogerthomas84 / sh.sh
Created April 26, 2024 07:47
exiftool google photos takeout fix command
# Get exiftool here -> https://exiftool.org/
exiftool -r -d %s -tagsfromfile %d%f.%e.json -description "-createdate<creationdatetimestamp" "-datetimeoriginal<phototakentimetimestamp" "-modifydate<modificationtimetimestamp" -overwrite_original
@rogerthomas84
rogerthomas84 / generate-ssh-key.sh
Created December 23, 2020 10:14 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@rogerthomas84
rogerthomas84 / garage.py
Last active July 21, 2020 07:46
Simple python script for the kids
"""
The garage stores vehicles.
"""
class Garage:
_vehicles = []
def __init__(self):
pass
@rogerthomas84
rogerthomas84 / lower_case.json
Last active November 15, 2017 16:21
ISO-3166-1 - Alpha 2 Codes ISO - Country Dict
{
"af": "Afghanistan",
"ax": "Åland Islands",
"al": "Albania",
"dz": "Algeria",
"as": "American Samoa",
"ad": "Andorra",
"ao": "Angola",
"ai": "Anguilla",
"aq": "Antarctica",
@rogerthomas84
rogerthomas84 / troll_face_base_64.txt
Created October 17, 2017 14:46
Base64 Encoded Troll Face
iVBORw0K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et or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@rogerthomas84
rogerthomas84 / randommodel.py
Created February 23, 2017 09:06 — forked from mkhatib/randommodel.py
Abstract Random AppEngine ndb.Model. Extend this class and use .random method to get random entities/records.
import random
from google.appengine.ext import ndb
class RandomIndexedModel(ndb.Model):
"""Abstracts how we do randomness in the other models."""
random_index = ndb.FloatProperty('ri')
@classmethod
def random(cls, count=1, exclude=None, ancestor=None, filters=None):
from google.appengine.api import mail
from google.appengine.api import urlfetch
import json
class PMEmailMessage(mail.EmailMessage):
""" PMEmailMessage subclass that enables you to call the pmsend()
method in order to send via Postmark instead of using GAE's
built-in mail service.
"""
@rogerthomas84
rogerthomas84 / convert-UNIX-timestamp.js
Created October 31, 2016 08:42 — forked from kmaida/convert-UNIX-timestamp.js
Convert a UNIX timestamp to user's local time via JavaScript
function convertTimestamp(timestamp) {
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds
yyyy = d.getFullYear(),
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0.
dd = ('0' + d.getDate()).slice(-2), // Add leading 0.
hh = d.getHours(),
h = hh,
s = ('0' + d.getSeconds()).slice(-2), // Add leading 0.
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0.
ampm = 'AM',