Skip to content

Instantly share code, notes, and snippets.

@egeste
egeste / organize_plex_files.py
Last active August 6, 2024 05:06
Rename movie files on your plex server based on matched data from the plex API
#!/usr/bin/env python
import os
import re
import shutil
import argparse
from unidecode import unidecode
from plexapi.server import PlexServer
@egeste
egeste / lib_crypto.ts
Created March 30, 2024 01:17
WIP - simplified encrypted chat interface
(async () => {
const atob = window.atob;
const btoa = window.btoa;
const DB_NAME = 'crypto_keys';
const DB_VERSION = 1;
const SIGNING_KEYS_STORE = 'signingKeys';
const ENCRYPTION_KEYS_STORE = 'encryptionKeys';
function base64ToBuffer(base64: string): ArrayBuffer {
@egeste
egeste / markdown_changelog.sh
Last active June 21, 2023 05:37
Generate a markdown formatted changelog from a git branch
git log \
-E --merges \
--grep='Merged PR [0-9]+: Release [0-9]+.[0-9]+.[0-9]+.*' \
--format='# %ad%n## %s%n```%n%b%n```%n' \
--date=format-local:'%A %B %d, %Y'
@egeste
egeste / docker_dump.sh
Last active January 7, 2023 18:44
Dump/Extract a Docker Image Layers
################################################################################
# A simple script for dumping the layers of a docker image.
#
# Dependencies:
# * docker (duh)
# * jq (https://stedolan.github.io/jq/)
#
# Usage
# ./docker_dump.sh DOCKER_IMAGE_NAME
#
// Go to sumologic, open the chrome dev tools, paste this into the console, and run it (press enter).
// This script will cycle through all of your open dashboards in the current tab every 5 mins.
(function() {
let tabIndex = 0; // Start at index 0
const timeout = ((1000 * 60) * 5); // 5 min
setInterval(function () { // Start the timer
// Get whatever dashboard tabs are open at execution
const tabs = document.querySelectorAll('.tab-navigator__tab.tab-navigator__regular-tab._dashboard');
tabIndex++; // Increment the index
@egeste
egeste / withErrorBoundary.js
Created November 30, 2018 21:30
Using React 16 error boundaries in a decorator
import React, { PureComponent } from 'react'
import DefaultFallbackComponent from 'wherever'
export default (FallbackComponent = DefaultFallbackComponent) => {
return ComposedComponent => {
class ErrorBoundary extends PureComponent {
state: {
info: undefined,
error: undefined
@egeste
egeste / withEnforcedProps.js
Created November 12, 2018 19:47
Proptype enforcement decorator
import React, {
PureComponent
} from 'react'
export default ComposedComponent => {
return class EnforcedPropTypesComponent extends PureComponent {
// Expose the composed component's propTypes at the decorator level
static propTypes = ComposedComponent.propTypes
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">{
<xsl:apply-templates select="*"/>}
</xsl:template>
<!-- Object or Element Property-->
<xsl:template match="*">
"<xsl:value-of select="name()"/>" : <xsl:call-template name="Properties"/>
</xsl:template>
@egeste
egeste / unfollow-sc.js
Created May 29, 2018 21:55
Unfollow all on soundcloud
// 1. Go to https://soundcloud.com/you/following
// 2. Open javascript console.
// 3. Paste & hit <enter>
const unfollow = function() {
const button = document.querySelector('.sc-button-follow')
button && button.click()
button && setTimeout(unfollow, 0)
}; unfollow();
@egeste
egeste / autoexec.cfg
Last active February 21, 2018 21:38
My CS:GO binds
bind "MWHEELUP" "cl_righthand 1"
bind "MWHEELDOWN" "cl_righthand 0"
bind "w" "+forward; toggle cl_crosshaircolor 1 2 3 4 5"
bind "s" "+back; toggle cl_crosshaircolor 1 2 3 4 5"
bind "a" "+moveleft; toggle cl_crosshaircolor 1 2 3 4 5"
bind "d" "+moveright; toggle cl_crosshaircolor 1 2 3 4 5"
bind "c" "+duck; toggle cl_crosshaircolor 1 2 3 4 5"
bind "SPACE" "+jump; toggle cl_crosshaircolor 1 2 3 4 5"
bind "MOUSE1" "+attack; toggle cl_crosshaircolor 1 2 3 4 5"