Skip to content

Instantly share code, notes, and snippets.

View grough's full-sized avatar

Gavin Rough grough

View GitHub Profile
@grough
grough / upload_video.py
Created January 31, 2024 20:02
Upload YouTube Video
#!/usr/bin/python
import httplib2
import os
import random
import sys
import time
from apiclient.discovery import build
from apiclient.errors import HttpError
const path = require("path");
const { exec } = require("child_process");
const outputDir = process.env.OUTPUT_DIR;
const inputPath = process.argv[2];
const startTime = process.argv[3];
const endTime = process.argv[4];
const basename = path.basename(inputPath);
const [filename, extension] = basename.split(".");
@grough
grough / decimal-to-rgb.js
Last active August 23, 2019 01:23
Convert decimal number to RGB color components with JavaScript
function decimalToRgb(decimal) {
return {
red: (decimal >> 16) & 0xff,
green: (decimal >> 8) & 0xff,
blue: decimal & 0xff,
};
}
/*
Examples:
@grough
grough / keybase.md
Last active November 27, 2019 18:36

Keybase proof

I hereby claim:

  • I am grough on github.
  • I am grough (https://keybase.io/grough) on keybase.
  • I have a public key whose fingerprint is 272D FD79 4745 C0B6 EE34 A192 3BCB 71BA CE64 67B5

To claim this, I am signing this object:

@grough
grough / com.mizage.Divvy.plist
Created January 24, 2014 12:52
Divvy window manager configuration
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>enableAcceleration</key>
<string>YES</string>
<key>lastColumnCount</key>
<string>8</string>
<key>useDefaultGrid</key>
<string>YES</string>
@grough
grough / example.txt
Created October 6, 2011 18:57
Convert a percent rating to a five star grade
0 .....
1 ..... 21 X.... 41 XX... 61 XXX.. 81 XXXX.
2 ..... 22 X.... 42 XX... 62 XXX.. 82 XXXX.
3 ..... 23 X.... 43 XX... 63 XXX.. 83 XXXX.
4 ..... 24 X.... 44 XX... 64 XXX.. 84 XXXX.
5 /.... 25 X/... 45 XX/.. 65 XXX/. 85 XXXX/
6 /.... 26 X/... 46 XX/.. 66 XXX/. 86 XXXX/
7 /.... 27 X/... 47 XX/.. 67 XXX/. 87 XXXX/
8 /.... 28 X/... 48 XX/.. 68 XXX/. 88 XXXX/
9 /.... 29 X/... 49 XX/.. 69 XXX/. 89 XXXX/