Skip to content

Instantly share code, notes, and snippets.

@varenc
varenc / varen_christmas_2024.py
Last active September 20, 2024 21:41
Varen siblings + partners gift exchange pairings for Christmas 2024
import random
import pandas as pd
from tabulate import tabulate
SIBLINGS = ["McKenzie", "Reagan", "Danni", "Alex", "Thomas", "Ben", "Shane", "Eric", "Chris"]
PARTNERS = ["Emilie", "Julia", "Courtney", "Kirstyn", "Stefanie", "Rilka"]
sibling_partner_mapping = {
"Alex": "Emilie",
"Thomas": "Julia",
#include <stdio.h>
#include <stdint.h>
// Philips Sonicare NFC Head Password calculation by @atc1441 Video manual: https://www.youtube.com/watch?v=EPytrn8i8sc
uint16_t CRC16(uint16_t crc, uint8_t *buffer, int len) // Default CRC16 Algo
{
while(len--)
{
crc ^= *buffer++ << 8;
int bits = 0;
do
#pragma config(StandardModel,"EV3_REMBOT")
#pragma config(Sensor,S2,gyro,sensorEV3_Gyro,modeEV3Gyro_RateAndAngle)
#pragma config(Sensor,S1,HTIRS2,sensorI2CCustom)
#pragma config(Sensor, S4,sonar4,sensorEV3_Ultrasonic)
// Change Sensor number
//connect Ultrasonic to S4
#include "\EV3\3rd party driver library\include\hitechnic-irseeker-v2.h"
@g-simmons
g-simmons / yamlgrid_from_file.py
Created May 10, 2023 22:51
convert a dvc file template with parameter matrices into a final dvc file with corresponding foreach grids
import yaml
from itertools import product, starmap
from collections import namedtuple
import click
judgement_styles = [1, 2, 3, 4, 5]
groups = ["liberal", "conservative"]
def named_product(**items):
@Cierra-Runis
Cierra-Runis / main.dart
Created May 10, 2023 22:49
tangled-rose-8335
void main() {
final templateUrl = '{host}/api/v3/{container}/{resourceId}';
final params = <String, dynamic>{
'host': 'www.api.com',
'container': 'books',
'resourceId': 10
};
print(templateUrl.asTemplate(params)); // www.api.com/api/v3/books/10
================================== iphone11,2 ===================================================
14.4.1-14.2
key : 5a37b94ad2b79cb789ed930f0dff883ed0487a86151844450e0a197070647369e9691f5091c202ab8699939f31bf6c4a
18B92/14.2
key : aa0684897a2a372e7bcb0f26625a70142bdb671267af4d23a2ec851910c7e8641a738ce63c1fccc558b480baa0b086f2
@varenc
varenc / _retrieve_mac_apps.sh
Last active March 29, 2022 23:41
Fix macOS zsh `open -a` application completion! Apple's version has a very old bug. See: https://stackoverflow.com/questions/59865427/zsh-hangs-on-open-application-tab-autocompletion#63097652
#autoload
### 2022-02-09 @varenc
### This is a fixed version of the macOS zsh completion script for the `open` command.
### See my response here for a description of the bug:
### https://stackoverflow.com/questions/59865427/zsh-hangs-on-open-application-tab-autocompletion#63097652
###
### tl;dr; The original completion script is provided by Apple and not-editable by the user without disabling SIP.
### It has a bug in it and doesn't use the Spotlight index to list applications. This makes auto-completion
### for the command "open -a ..." very slow/impossible.
@gwillem
gwillem / _cronrat.sh
Last active August 27, 2024 18:17
This is the decoded payload from the CRON loader. Full analysis here: https://sansec.io/research/cronrat
set -eEu
set -o pipefail
trap 'echo "L$LINENO"; O70; exit -1' ERR
O54=4
function O70()
{
if [[ ! -z "${O57+x}" ]]; then
if [[ -f "${O57}" ]]; then
rm -f "${O57}"
fi
@romkatv
romkatv / run-command.zsh
Last active October 25, 2024 11:50
Zsh function to run a command and capture its status, stdout and stderr
# Runs "$@" in a subshell with the caller's options, sets reply=(stdout stderr)
# and returns the status of the executed command. Both stdout and stderr are
# captured completely, including NUL bytes, incomplete UTF-8 characters and
# trailing LF, if any.
#
# Example:
#
# % zsh-run-command ls -d ~ /garbage
# % printf 'status: %s\nstdout: %s\nstderr: %s\n' $? "${(q+)reply[@]}"
# status: 2
@dlevi309
dlevi309 / MGAllowedProtectedKeys.xml
Last active May 6, 2022 01:32
All the values that iOS grants when using the ‘com.apple.private.MobileGestalt.AllowedProtectedKeys‘ entitlement
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.private.MobileGestalt.AllowedProtectedKeys</key>
<array>
<string>AWDID</string>
<string>AmbientLightSensorSerialNumber</string>
<string>ArcModuleSerialNumber</string>
<string>ArrowChipID</string>