Skip to content

Instantly share code, notes, and snippets.

@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active May 17, 2024 14:14
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@pythoninthegrass
pythoninthegrass / cloud-init.ubuntu.yml
Last active May 17, 2024 14:13
cloud-init (cloud-config) ubuntu template for latest python, docker, ansible, github ssh keys,dns, and shell config
#cloud-config
output: {all: '| tee -a /var/log/cloud-init.log'} # store logs inside vm
timezone: "America/Chicago"
hostname: ubuntu
package_update: true
package_upgrade: true
@thdtt
thdtt / activate.cmd
Created July 15, 2021 06:12
Office 365 Activator
@echo off
title Activate Office 365 ProPlus for FREE - MSGuides.com&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products: Office 365 ProPlus (x86-x64)&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&echo Activating your Office...&cscript //nologo slmgr.vbs /ck
@aburjg
aburjg / homoiconic-python-post.md
Last active May 17, 2024 14:12
Homoiconic Python Post
@NickMcSweeney
NickMcSweeney / postgresql_plus_arch-linux.md
Last active May 17, 2024 14:08
Getting postgresql running on Arch Linux

Setup Postgresql

run postgresql with systemctl

Install postgres

latest

sudo pacman -S postgresql

specific version

find version & build from source

@guilherme
guilherme / gist:9604324
Last active May 17, 2024 14:09
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@sindresorhus
sindresorhus / esm-package.md
Last active May 17, 2024 14:07
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Zygmut
Zygmut / cache_to_file.py
Last active May 17, 2024 14:13
A python decorator to cache results to files (with dynamic filenames given argument contents!)
def cache_to_file(filename):
class DateTimeEncoder(JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
return super().default(o)
def decorator(func):
def wrapper(*args, **kwargs):
for os.path.sep in filename:
@soatok
soatok / matrix.md
Last active May 17, 2024 13:57
Why I Don't Trust Matrix Developers to Produce a Secure Protocol

Ever since I wrote It's Time For Furries to Stop Using Telegram, I've had a few folks ask me about my opinion on Matrix.

(I've also had a few people evangelize Matrix in my mentions. That's annoying.)

My stance on Matrix has been the same for years: I don't trust the Matrix developers to produce a secure protocol, and until they abandon Olm / Megolm in favor of something like MLS, I'm adamant about refusing to trust their team's designs.

To understand why I feel so strongly about this, you need to understand that practically exploitable vulnerabilities were found in Matrix in 2022.

It isn't enough that there were vulnerabilities found to be alarming. Vulnerabilities happen. You aren't writing software if you don't occasionally fuck up.

@OdinsHat
OdinsHat / esptool-in-linux.sh
Last active May 17, 2024 13:57
Esptool being used to install ESPEasy in Linux
#!/bin/sh
#this is the command to type when installing ESP Easy to your ESP8266 device.
sudo python esptool.py --port /dev/ttyUSB0 write_flash 0x00000 ESP_Easy_mega-20200426_dev_ESP8266_4M1M.bin