Skip to content

Instantly share code, notes, and snippets.

@encoreshao
encoreshao / PostgreSQL-10-Master-Slave-Replication.md
Last active July 23, 2024 10:31
PostgreSQL 10 Master-Slave Replication on Virtualbox

PostgreSQL 10 Master-Slave Replication on Virtualbox

Preparations

@interactiveRob
interactiveRob / copy-to-clipboard-es6.js
Last active October 6, 2021 10:09
Copy String to Clipboard ES6 Method
copyToClipboard(str) {
/* ——— Derived from: https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
improved to add iOS device compatibility——— */
const el = document.createElement('textarea'); // Create a <textarea> element
let storeContentEditable = el.contentEditable;
let storeReadOnly = el.readOnly;
el.value = str; // Set its value to the string that you want copied
el.contentEditable = true;

Sony Bravia HTTP API

The sony bravia has a HTTP API interacted with using a Pre-Shared key. There's a more complex auth flow but I've not described it here.

There wasn't any documentation, so I've written some. If you're a TV integrator don't read this, you'll laugh. I'm probably just getting confused by UPnP.

Disclaimer: I've only tested this on my TV, which is a KDL-50W829B. Your TV might not have all of the services; see Available services section for how to discover what your TV supports.

@BretFisher
BretFisher / docker-for-mac.md
Last active September 18, 2024 18:51
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1