Skip to content

Instantly share code, notes, and snippets.

@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)
@pixeline
pixeline / readme.md
Created June 1, 2019 11:52
Deploy a "docker-composed" environment on DigitalOcean

Deploy docker-compose on digitalocean

  1. create Docker droplet via digitalocean one-click-app-docker
  2. log into it
  3. generate SSH key
ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa
  1. Copy it
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 3, 2024 21:04
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