Skip to content

Instantly share code, notes, and snippets.

@MontyThibault
MontyThibault / example.js
Last active October 9, 2022 10:45
Simplified Octree/Quadtree Partitioning in THREE.js
// Create the tree
var box = new THREE.Box3(new THREE.Vector3(-25, -25, -25), new THREE.Vector3(25, 25, 25));
var tree = new Octree(box, {
maxDepth: 10,
splitThreshold: 5,
joinThreshold: 3
});
scene.add(tree);
// Add children the same way you would any other regular object.
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active November 11, 2024 22:46
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@jackoalan
jackoalan / gen_dolphin_map.idc
Last active January 9, 2018 01:19
Generates a dolphin-emu compatible .map file from an IDA database
auto address = NextFunction(0);
auto filestr = AskFile(1, "*.map", "Dolphin MAP output file");
auto file = fopen(filestr, "w");
fprintf(file, ".text\n");
while (address != -1) {
auto name = GetFunctionName(address);
auto demangle_name = Demangle(name, GetLongPrm(INF_LONG_DN));
if (strlen(demangle_name) > 1)
name = demangle_name;
if (strlen(name) > 1) {
@noelboss
noelboss / git-deployment.md
Last active November 19, 2024 08:04
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

import traceback
from binaryninja import (BinaryView, Architecture, SegmentFlag, log_error,
get_address_input, log_info, SectionSemantics)
offset = 0x08000000
entry_addr = 0x080001c0
class FwImgView(BinaryView):
@marcan
marcan / vortex_patch.py
Created December 22, 2018 10:09
Alesis Vortex Wireless 2 patch to send MIDI messages when pressing the ribbon bank buttons
from asm import *
blob = open("image.bin", "rb").read()
start_addr = 0x08003000
patch_start = start_addr + len(blob)
assert patch_start % 4 == 0