Skip to content

Instantly share code, notes, and snippets.

View mikalv's full-sized avatar

Mikal mikalv

View GitHub Profile
@PJUllrich
PJUllrich / big-o.md
Last active February 13, 2025 23:48
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@LeeKahSeng
LeeKahSeng / KeychainHelper.swift
Last active April 21, 2025 23:25
Swift simple keychain helper class for iOS and macOs
// MIT License
//
// Copyright (c) 2023 Lee Kah Seng
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@hartescout
hartescout / reference.txt
Last active March 4, 2023 00:15
macOS Internals, Reversing, and Analysis reference I've found essential.
## In no particular order. I'm pulling these from a bookmark folder, I'll work on labeling as I have time. Hope these help. Will be mixing in Linux reference as well.
Sidenote: the macOS Internals series is amazing, although might be out of reach for some. However if having a hard time deciding (I definitely way) and in budget, In my opinion, they are worth the price. I've worked through Volume II, waiting on Volume III.
As always, most of what we need in our world can be found open sourced and provided by some of the brightest, but it can be a frustrating journey finding material.
https://www.intezer.com/blog/malware-analysis/elf-malware-analysis-101-linux-threats-no-longer-an-afterthought/
http://timetobleed.com/dynamic-linking-elf-vs-mach-o/
https://github.com/apple/darwin-xnu
https://opensource.apple.com/source/xnu/
https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/Architecture/Architecture.html
@mattmc3
mattmc3 / split.zsh.md
Last active May 15, 2025 09:44
ZSH - split string into array

There are a ton of different ways to split up a string in Zsh. This gist attempts to show them with examples to help you build your own. I write Zsh scripts all the time, and still reference back to this gist, so there you go.

From the Zsh docs on Parameter Expansion Flags (yeah - I know... how would anyone ever find that if they didn't know where to look!?)

j:string: Join the words of arrays together using string as a separator.
s:string: Force field splitting at the separator string.

You can also read more by running man zshexpn. (Again, I know, right!? How would anyone know to look there!?)

@korc
korc / pkcs11-tls-proxy.go
Last active December 21, 2023 02:46
PKCS11-authenticated TLS socket proxy
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"net/textproto"
@mageddo
mageddo / main.cpp
Created June 20, 2020 20:46
Load jar and execute class method from JVMTI + JNI
#include <jvmti.h>
#include <cstring>
#include <iostream>
void debug(char* msg...){
// printf(msg);
}
int loadJar(JNIEnv *jni){
@evert0n
evert0n / fields.py
Created November 20, 2019 05:48 — forked from iamahuman/fields.py
Virtual Field for Django
from django.db.models import Field
from django.conf import settings
from django.utils.decorators import cached_property
class VirtualField(object):
"""
A virtual field, mainly used for caching and seamless computed field retrieval.
This acts both like a (cached) property and a virtual field if supported.
"""
@darwin
darwin / readme.md
Last active April 9, 2024 22:30
APFS Container cloning/replicating under Catalina (with a bootable system)

Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. I upgraded my late 2014 Mac Mini with a shiny new 1TB SSD. This took way too many hours of my life I will never get back. Hope this saves some time to you.

Good news:

  1. it is possible to create a DMG image from existing APFS container with macOS Catalina installation including metadata needed for complete restore (the DMG contains OS, OS Data, Preboot, Recovery and VM volumes)
  2. it is possible to restore this DMG image into empty APFS container and get a bootable copy of the original system

This information is relevant for Catalina (I'm currently running macOS 10.15.1).

@darconeous
darconeous / tesla-key-card-protocol.md
Last active April 8, 2025 23:28
Tesla Key Card Protocol

Tesla Key Card Protocol

Researched by Robert Quattlebaum [email protected].

Last updated 2020-02-03.

Image of Tesla Key Card Image of Tesla Model 3 Key Fob

@qcasey
qcasey / README.md
Last active May 8, 2025 15:43 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Ubuntu / Debian for non-raspbian SBCs (ODROID, Orange Pi, Armbian, etc)

About

This gist will show how to setup a generic SBC Debian / Ubuntu install as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

This is forked from another gist specific to the Raspberry Pi on Stretch. A required package isn't in Ubuntu's repos, so in this gist we build it from scratch.

Tested to be working on Armbian/Ubuntu/Debian images of the Orange Pi Zero, ODROID XU4, ODROID N2, and Atomic Pi.

Prerequisites