Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 3, 2024 21:16
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@gustavomdsantos
gustavomdsantos / AutoHotKey script - Always-on-top.ahk
Last active May 3, 2024 21:15
AutoHotKey script that make any window Always-on-Top on Windows.
; Press Ctrl+Shift+Space to set any currently active window to be always on top.
; Press Ctrl+Shift+Space again set the window to no longer be always on top.
; Source: https://www.howtogeek.com/196958/the-3-best-ways-to-make-a-window-always-on-top-on-windows
^+SPACE::
WinGetTitle, activeWindow, A
if IsWindowAlwaysOnTop(activeWindow) {
notificationMessage := "The window """ . activeWindow . """ is now always on top."
notificationIcon := 16 + 1 ; No notification sound (16) + Info icon (1)
}
@mildsunrise
mildsunrise / blobs.py
Last active May 3, 2024 21:15
Logic to work with Android KeyMaster blobs and Vold
#!/usr/bin/env python3
'''
keymaster blob logic.
Offers:
- low-level blob encoding and decoding
- loading softkeymaster blobs
- performing cryptographic operations (emulating KeyMaster) on a loaded blob
- CLI tool for parsing softkeymaster blobs and performing operations with them
@Klerith
Klerith / configurar-node-ts.md
Last active May 3, 2024 21:14
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
using System.DirectoryServices.AccountManagement;
public static bool UserExistsAndIsActive(string username)
{
PrincipalContext context = new PrincipalContext(ContextType.Domain, domain);
UserPrincipal usr = UserPrincipal.FindByIdentity(context, IdentityType.UserPrincipalName, username);
if (!object.ReferenceEquals(null, usr))
{
if (!(bool)(usr.Enabled))
@hfloyd
hfloyd / Error404Page.cs
Created May 3, 2024 15:04
Umbraco v13+ 404 Error IContentLastChanceFinder - Supporting multiple sites at root
namespace MYSITE.Web;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Web;
using Umbraco.Extensions;
@yermulnik
yermulnik / config.yml
Last active May 3, 2024 21:08
GH CLI multi-account switch
git_protocol: ssh
aliases:
personal: '!cp ~/.config/gh/hosts.yml.personal ~/.config/gh/hosts.yml && gh auth status'
work: '!cp ~/.config/gh/hosts.yml.work ~/.config/gh/hosts.yml && gh auth status'

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@iamevn
iamevn / cdromance-download-links.user.js
Last active May 3, 2024 21:02
simple userscript to insert download links back into cdromance (you might need to refresh the page if the links break) (click raw link near top right to install)