Skip to content

Instantly share code, notes, and snippets.

View illegalprime's full-sized avatar

Michael Eden illegalprime

View GitHub Profile
@illegalprime
illegalprime / Frankfurt 42.md
Last active August 6, 2023 00:36
netrunner
Count Name Cycle Identity
2x Déjà Vu Core Set, 2 Omar Keung: Conspiracy Theorist
2x Demolition Run Core Set, 3 Omar Keung: Conspiracy Theorist
2x Stimhack Core Set, 4 Omar Keung: Conspiracy Theorist
3x Cyberfeeder Core Set, 5 Reina Roja: Freedom Fighter
@illegalprime
illegalprime / imds-tap.py
Created December 8, 2020 04:47
listen in on remote IMDS calls
#!/usr/bin/env python3
import struct
import asyncio
import logging
from argparse import ArgumentParser
import dpkt
@illegalprime
illegalprime / external.js
Last active June 8, 2020 16:18
circular dependency node
const internal = require('./internal.js');
const other = require('./other.js');
internal.Greeting.prototype.greet = function() {
const instance = new other.Other();
return instance.speak() + ' ' + this.hello();
};
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
(callPackage ./sddm-theme-chili.nix {})
];
services.xserver.displayManager.sddm.theme = "plasma-chili";
}
@illegalprime
illegalprime / keybase.md
Created April 1, 2018 17:45
Keybase Identity Proof

Keybase proof

I hereby claim:

  • I am illegalprime on github.
  • I am illegalprime (https://keybase.io/illegalprime) on keybase.
  • I have a public key ASCNXYnT_0GXsoD2McoNOyzIY2Zar2YkQe0IFUysRAd1fQo

To claim this, I am signing this object:

@illegalprime
illegalprime / autobahn-server-2016.html
Created April 2, 2017 00:07
Current results for autobahn server.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style lang="css">
body {
background-color: #F4F4F4;
color: #333;
font-family: Segoe UI,Tahoma,Arial,Verdana,sans-serif;
}
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
def check_bst(node):
left_min, left_max, left_bst = (node.data, -1, True)
right_min, right_max, right_bst = (float("inf"), node.data, True)
if node.left is not None:
left_min, left_max, left_bst = check_bst(node.left)
if node.right is not None:
right_min, right_max, right_bst = check_bst(node.right)
return (left_min, right_max, left_bst and right_bst and node.data > left_max and node.data < right_min)
def check_binary_search_tree_(root):
def check_palindrome(message):
rm = lambda msg, i: msg[:i] + msg[i + 1:]
words = [(message, -1)] + [(rm(message, i), i) for i in range(len(message))]
checked = map(lambda (word, i): (word == "".join(reversed(word)), i), words)
return filter(lambda (is_pal, i): is_pal, checked)[0][1]
for _ in range(int(raw_input())):
print(check_palindrome(raw_input().strip()))
@illegalprime
illegalprime / snake_toCamel.sh
Created August 6, 2016 04:42
Convert all files from snake_case to camelCase
#!/usr/bin/env bash
# Author michael
set -euo pipefail
SNAKE_CASE_FILE="/tmp/snake-case-$$"
# gather all the camel case in the source
grep -P -R -o -h ' ([a-z0-9]+_)+[a-z0-9]+' | sort -u > "$SNAKE_CASE_FILE"
# let user filter which ones they want to replace