This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# note to self: packages for building on fedora(ish) are | |
# autoconf automake libtool glib2-devel json-glib-devel systemd-devel libus1-devel libX11-devel libXrandr-devel jansson-devel | |
# read. worth noting that no registers ever changed between input swapping HDMI1 and DP. also maybe worth noting that i dont think --i1 x50 would do anything here, but im no expect i literally discovered ddc existed today | |
$ ddcutil getvcp scan --i1 x50 | |
VCP code 0x02 (New control value ): One or more new control values have been saved (0x02) | |
VCP code 0x0b (Color temperature increment ): Invalid value: 0 | |
VCP code 0x0c (Color temperature request ): 3000 + 35 * (feature 0B color temp increment) degree(s) Kelvin | |
VCP code 0x0e (Clock ): current value = 50, max value = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateRandomColour () { | |
return '#'+(Math.random() * 0xffffff | 0).toString(16).padStart(6, '0') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use nodejs to load location history.json from your google takeout folder -b | |
var data=require('./Location History') | |
var times=data.locations.map(d=>parseInt(d.timestampMs)) | |
var between=times.map((t,i) => times[i-1] ? t-times[i-1] : 0 ) | |
var mean=between.reduce((a,v)=>a+v)/between.length | |
var meanInMinutes=mean/1000/60 | |
console.log("Google location data reported every " + meanInMinutes + " minutes.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# open | |
# macOS open command for WSL (Windows Subsystem for Linux) | |
# written by benjamin gwynn (https://benjamingwynn.com) | |
# get latest version here: https://gist.github.com/benjamingwynn/a778aa6cf2dd461dc18978f245bd90c1 | |
# | |
# You can run this on WSL wuth no prior setup or changes to host Windows. | |
# | |
# See: * https://docs.microsoft.com/en-us/windows/wsl/interop#run-windows-tools-from-linux | |
# * https://stackoverflow.com/a/501295 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Actually gets Google Home's bluetooth to connect reliably on Windows 10. | |
# Unpairs Windows AND Google Home using MAC address, then sets everything up for a one-click connection. | |
# * Prevents Google Home from getting stuck paried using bttool, which is apparently the only way to fix that? | |
# * Uses some code from Stack Overflow to get the IP from the MAC address so you don't have to dick around with static IP's | |
# * Connects reliably by repairing bluetooth on Google Home using the "secret" REST API (https://rithvikvibhu.github.io/GHLocalApi) | |
# * Opens control legacy panel after setting up Google for pairing | |
# | |
# Needs btpair installed first, get it from http://bluetoothinstaller.com/bluetooth-command-line-tools/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Image object for WebAppManifest */ | |
declare interface WebAppManifestIcon { | |
/** A string containing space-separated image dimensions. */ | |
sizes: string, | |
/** The path to the image file. If src is a relative URL, the base URL will be the URL of the manifest. */ | |
src: string, | |
/** A hint as to the media type of the image. The purpose of this member is to allow a user agent to quickly ignore images of media types it does not support. */ | |
type: string, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
White modern theme for ProtonMail | |
Work-in-progress (v2) - Copyright Benjamin Gwynn, 2017 (http://benj.pw) | |
*/ | |
body { | |
--font: "Roboto", "Cantarell", "Segoe UI", "Ubuntu", sans-serif; | |
font-family: var(--font); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy current children except a certain child while keeping all refs - a pain in the ass. | |
let i = oldParent.childNodes.length - 1 | |
for (; i >= 0; i -= 1) { | |
const c = oldParent.childNodes[i] | |
// whatever, your condition here | |
if (c.nodeName.toLowerCase() !== "slot") { | |
newParent.appendChild(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TeamspeakQuery = require('teamspeak-query') | |
, query = new TeamspeakQuery('127.0.0.1', 10011) | |
, TARGET_CLIENT = 1 | |
, TARGET_CHANNEL = 2 | |
, TARGET_SERVER = 3 | |
, Steam = require("steam-webapi") | |
, console = require("better-console") | |
, jsonfile = require("jsonfile") | |
, SQ_PASSWD = "oh boy this sure is a secret password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* TeamSteam - written by Benjamin Gwynn for ts3.xenxier.com */ | |
const TeamspeakQuery = require('teamspeak-query') | |
, query = new TeamspeakQuery('127.0.0.1', 10011) | |
, TARGET_CLIENT = 1 | |
, TARGET_CHANNEL = 2 | |
, TARGET_SERVER = 3 | |
, Steam = require("steam-webapi") | |
, console = require("better-console") | |
, jsonfile = require("jsonfile") |
NewerOlder