Skip to content

Instantly share code, notes, and snippets.

const house2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABRUExURQCi6IxcQuD4/wCp8s3j6v///3hPOdnw97l6V6txUNuRZ55oSqhvT4gAFZnZ6pS9GLXmHbHgHByUQCKxTH9/f3BwcJSUlB+jRgCW2RuMPACS1H5T8LYAAAAJcEhZcwAAFiQAABYkAZsVxhQAAASZSURBVFhHfZSNYqM2EISpg3MYSHOJY9+17/+gnW9mJcDuZRDS6mdGuyvB8C3+MqrzZ5z8POGl+FF4UTHS1JAxnsbzeURkHEb1tSSTor7mFYkJ0234Tec0/DBfZTzJDyQCU6dpsg/mWAKUmAXY9zycgYTOI7EwZ/9Fv8xLfMhqUxu/MOKBuFYZ5EXxX83XKx9elQcPh10K1pDL4o9FHxWJFxD7NE8qPI4CkolpoyEQwhkVaYhNHpJ/drcD9sFnwdZu4FOVgANQTUp9nkmfHHClsnQFWC7RiIIFxD+dpAZfaN7bB0kwlgthUlVugHijD0DwUpGKPM2XaZ1WnwWJGIa3N2RkVAzy2vsGL+HHfVwwVnU8IYE3IWRH0fBC9Orm+szrqjKpuqxkwUqa4TiHdWUl7DoHQYdPU9dfi7UlZRUVEExOUwrr5K1gPPmhBdwfbzivrnUX20BdiAmBUF2HahnyhPuCXOcxrWNxKgnBCo1afiT/y9zdVxIC7X9JHhZ8IAR4m0A0zG/eKoGYvo0kICcKtAYP4oIlqOkp/NcFXhDPi4imH0kTBTyorqxU1591l5Y1WhqnQaV5kY8zTMMNo4vXgWqegNJSV8quA1oN6PhMm/GAhdqyuS0nMmAVf1tyovNlKKyFzHN0LnovOob0OdhULuu8rHEhCrTs77RrG24wFaFzERD2Q+vLIYVjDK597wCN3hS9eoTMYMj0VRJKQUHI8PnNS4PXU2LoEnpw0bMJeG
@Decad
Decad / twitch.js
Last active November 2, 2020 11:00
Block twitch preroll
/// twitch-videoad.js
const origFetch = window.fetch;
window.fetch = (url, init, ...args) => {
if (typeof url === "string") {
if (url.includes("/access_token")) {
url = url.replace("player_type=site", "player_type=embed");
} else if (
url.includes("/gql") &&
init &&
typeof init.body === "string" &&
@Decad
Decad / main.py
Last active September 20, 2020 19:49
Wildcards with snips-nlu
from __future__ import unicode_literals, print_function
import io
import json
from snips_nlu import SnipsNLUEngine
from snips_nlu.default_configs import CONFIG_EN
from snips_nlu.dataset import Dataset
with io.open("dataset/remind.yaml") as f:
dataset = Dataset.from_yaml_files("en", [f])
In your all your plugins you extend QuirkPlugin now not CSharpPlugi.
Then you can put `[ChatCommand("auth")]` style attributes on your chat commands rather than register them
@Decad
Decad / .dircolors.wsl
Created July 16, 2019 00:26 — forked from sgur/.dircolors.wsl
Dircolors for WSL
# dircolors for WSL
# Usage: eval `dircolors ~/.dircolors.wsl` (bash)
# http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors
TERM Eterm
TERM ansi
TERM color-xterm
TERM con[0-9]*x[0-9]*
TERM cons25
@Decad
Decad / pre-commit.sh
Created November 27, 2017 20:01 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done
git log --author="<Name>" | grep Date | awk '{print " : "$4" "$3" "$6}' | uniq -c
@Decad
Decad / perf.js
Created October 14, 2014 10:13
perf
var gZeroLeft = 0;
var gZeroTop = 0;
var gWinWidth = window.innerWidth || document.documentElement.clientWidth;
function findImages() {
var aElems = document.getElementsByTagName('*');
var re = /url\((http.*)\)/ig;
for ( var i=0, len = aElems.length; i < len; i++ ) {
var elem = aElems[i];
var style = window.getComputedStyle(elem);
@Decad
Decad / install.bat
Created March 3, 2014 09:07
Install Chocolatey using system default proxy
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$wc=new-object net.webclient; $wc.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$wc.DownloadString('https://chocolatey.org/install.ps1') | iex" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
@Decad
Decad / faupgrade.js
Created October 24, 2013 17:07
Font Awesome Upgrade 3.x - 4.0
/*
* Quickly made upgrade script from running through html files and replacing old font awesome classes with new. Be warned will make changes to any icon-* classes
*
* Author: Declan Cook
* Usage: node faupgrade.js <htmlfile>
*/
var fs = require('fs'),
lookup = {"ban-circle":"ban","bar-chart":"bar-chart-o","beaker":"flask","bell":"bell-o","bell-alt":"bell","bitbucket-sign":"bitbucket-square","bookmark-empty":"bookmark-o","calendar-empty":"calendar-o","check":"check-square-o","check-empty":"square-o","check-minus":"minus-square-o","check-sign":"check-square","chevron-sign-down":"chevron-circle-down","chevron-sign-left":"chevron-circle-left","chevron-sign-right":"chevron-circle-right","chevron-sign-up":"chevron-circle-up","circle-arrow-down":"arrow-circle-down","circle-arrow-left":"arrow-circle-left","circle-arrow-right":"arrow-circle-right","circle-arrow-up":"arrow-circle-up","circle-blank":"circle-o","collapse":"caret-square-o-down","collapse-alt":"collapse-o","collapse-top":"caret-square-o-up","comment-a