Skip to content

Instantly share code, notes, and snippets.

// Configuration object for the search
const searchConfig = {
searchCriteria: { user: { id: true, email: true } }, // What we're looking for
maxDepth: 50, // How deep to search in the tree
stopAfterFirst: false, // Whether to stop after finding the first match
searchPaths: ["memoizedProps", "memoizedState"], // Where to look in each node
mainSelector: "#__next", // The root element of our React app
callback: (matchingObjects) => {
matchingObjects.forEach(({ matchingObject, fiberNode }) => {
console.log("Found matching object:", matchingObject);
@MatanShahar
MatanShahar / target.xml
Last active November 1, 2024 22:06
GDB qXfer target description for real-mode qemu
<?xml version="1.0"?>
<!-- Copyright (C) 2010-2017 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. -->
<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target>
<architecture>i8086</architecture>
@adulau
adulau / ghidra-community.md
Last active November 11, 2023 13:16
Ghidra community - collection
@ThomasLeister
ThomasLeister / mastodon-tootctl-media-purge.txt
Created February 21, 2019 19:07
How to automatically remove cached media files older that 7 days from your Mastodon instance
This is how to automatically delete cached image previews from your Mastodon instance if they are older than 7 days.
Log in as your "mastodon" User or log in as root and then change to the "mastodon" user, who runs Mastodon:
# su - mastodon
Open crontab:
$ crontab -e
... and add these lines to your crontab:
@gsingh93
gsingh93 / gdb_init_real_mode.txt
Created June 17, 2018 01:32
Mirror of this GDB script for debugging x86 16-bit real mode code: http://www.capp-sysware.com/misc/stackoverflow/gdb_init_real_mode.txt
# Special mode for GDB that allows to debug/disassemble REAL MODE x86 code
#
# It has been designed to be used with QEMU or BOCHS gdb-stub
#
# 08/2011 Hugo Mercier - GPL v3 license
#
# Freely inspired from "A user-friendly gdb configuration file" widely available
# on the Internet
set confirm off
@shekkbuilder
shekkbuilder / gdbcomm.txt
Created February 23, 2016 00:52
GDB commands by function - simple guide
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@yoavmatchulsky
yoavmatchulsky / gist:7a04a6008ca06a65e9de
Created October 8, 2015 11:00
Mobile detection configuration for nginx
# /var/log/nginx/conf.d/mobile.conf
map $http_user_agent $mobile {
default 0;
~*(android|bb\d+|meego).+mobile|ip(hone|od)|opera\sm(ob|in)i|mobile.+firefox 1;
~*iemobile|phone|symbian|windows\sce|blackberry|up\.(browser|link) 1;
~*avantgo|bada\/|blazer|compal|elaine|fennec|hiptop|iris|kindle|lge\s|maemo 1;
~*midp|mmp|netfront|palm(\sos)?|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0 1;
~*treo|vodafone|wap|xda|xiino 1;
~*^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\swa|abac|ac(er|oo|s\-)) 1;
@varemenos
varemenos / 1.README.md
Last active April 4, 2025 03:30
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@yosefw
yosefw / static_footer
Last active August 29, 2015 14:09
Static footer that sticks to the bottom, regardless of content height. Based on http://mystrd.at/modern-clean-css-sticky-footer/
@jpsim
jpsim / JAZMusician.h
Created July 7, 2014 09:25
SourceKit Playground
//
// JAZMusician.h
// JazzyApp
//
#import <Foundation/Foundation.h>
/**
JAZMusician models, you guessed it... Jazz Musicians!
From Ellington to Marsalis, this class has you covered.