Skip to content

Instantly share code, notes, and snippets.

View OmgImAlexis's full-sized avatar
🇹🇼

Alexis Tyler OmgImAlexis

🇹🇼
View GitHub Profile
@sbyx
sbyx / notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml
Last active April 10, 2024 15:09
Home Assistant Blueprint: Notify or do something when an appliance like a dishwasher or washing machine finishes
blueprint:
name: Appliance has finished
description: Do something when an appliance (like a washing machine or dishwasher)
has finished as detected by a power sensor.
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
@Catbuttes
Catbuttes / Mee6Response.md
Created February 4, 2020 13:18
Mee6 GDPR response

Hi 👋

i wasn't able to find a discord account linked to this email address 😦 underneath is the info you asked, including some extra's as you asked some stuff that isn't in the standard GDPR request email. if you can give me your Discord User ID then i can make the extract of your data. (how to get user ID: http://dis.gd/userid or on the MEE6 website, your name top right, billing, account information, field discord ID) Ps. i would be interested in knowing how many other bots provided all the needed data within 30 days. one of the previous times someone asked us all this, he told us that we where the only one to correctly answer within 30 days. curious to know how it changed over time, if you want to tell me that ofcourse)


Hi,

@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 28, 2024 01:45
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@hongkongkiwi
hongkongkiwi / setup_unraid_ssh.sh
Created November 23, 2017 03:57
Small script to setup ssh keys and configs on Unraid to persist after boot. Supports multiple users.
#!/bin/bash
# Add this line into /boot/config/go where username is the user you want to setup, probably root
#/boot/config/ssh/setup_ssh_client.sh "username"
if [[ "$1" == "" ]]; then
echo "Invalid User!"
exit 1
fi
@ncochard
ncochard / babel-webpack.md
Last active September 29, 2023 05:15
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@0xallie
0xallie / lossless-stream-rip-cheatsheet.md
Last active April 3, 2024 06:11
Lossless stream rip cheatsheet

Lossless stream rip cheatsheet

Note: This guide may be slightly outdated. It may be still useful for older releases, but nowadays the vast majority of releases are correctly tagged as WEB-DL (unless it's RARBG/rartv). Protip: prefer looking at file names instead of release names, as they tend to be more accurate.

This is a short cheatsheet to help you determine whether a release from Amazon, Hulu, or Netflix contains the lossless/untouched (as in no further loss of quality compared to what the streaming services provide) video/audio or not. Most newer P2P releases are correctly tagged, but for older releases, it cannot be reliably determined based on the tags alone.

In most cases, non-lossless rips from these services are screen captures (which, when done by professional releasers, should be high quality and contain little to no glitches – see the history section for details), but in some cases they may be simply reencoded from the untouched stream, for example to crop black bars or reencode from a

#!/usr/local/bin/bash
source ~/.bash_profile
cd ~/"Apps/SickRage"
git remote set-url origin https://donna.devices.wvvw.me/sickrage/sickrage.git
git remote set-branches --add origin master
git remote update
git fetch origin
git checkout master
git branch --set-upstream-to origin/master
git reset --hard origin/master
@Rich-Harris
Rich-Harris / footgun.md
Last active April 19, 2024 07:47
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@slavafomin
slavafomin / nodejs-custom-es6-errors.md
Last active March 9, 2024 12:03
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@rmoorman
rmoorman / babelrc-vs-webpack-babel-loader-configuration.md
Created July 30, 2016 16:54
.babelrc vs webpack babel-loader configuration

Either you use .babelrc to specify environment specific settings (plugins or transforms for example) using the env key:

{
  "presets": ["es2015", "stage-0", "react"],
  "env": {
    "development": {
      "plugins": [
        ["transform-object-rest-spread"],
 ["transform-react-display-name"],