Skip to content

Instantly share code, notes, and snippets.

@sanusart
sanusart / readme.md
Last active January 23, 2025 07:29
use intersection observer hook #react #hooks

Usage example

const LazyListItem = () => {
 const [isInView, ref] = useIntersectionObserver<HTMLDivElement>();

 return (
   <div ref={ref}>
     {isInView ? (
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active January 23, 2025 07:27
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@thanoskoutr
thanoskoutr / squashfs-install.md
Last active January 23, 2025 07:27
Fix sasquatch installation for binwalk

Fix sasquatch installation for binwalk

For anynone that is running the latest version of binwalk (Binwalk v2.3.3) and when trying to extract squshfs filesystems, gets the following error:

WARNING: Extractor.execute failed to run external extractor 'sasquatch -p 1 -le -d 'squashfs-root' '%e'': [Errno 2] No such file or directory: 'sasquatch', 'sasquatch -p 1 -le -d 'squashfs-root' '%e'' might not be installed correctly

it might have to do that the sasquatch project is missing or not working correctly.

Install sasquatch

@amboutwe
amboutwe / yoast_seo_prev_next_change.php
Last active January 23, 2025 07:26
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change Yoast SEO Prev/Next URL on some pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
@novitae
novitae / README.md
Last active January 23, 2025 07:24
Palera1n & SSL Pinning / Reverse Cheatsheet

Palera1n & SSL Pinning / Reverse Cheatsheet

Jailbreak

  • Download latest release of palera1n.
  • Connect iphone to computer.
  • Jailbreak using palera1n --setup-fakefs --fakefs. This will setup fakefs to access to sudo later.
  • Once phone is running, run palera1n -f to load fakefs. Do it everytime you restart the phone to rejailbreak it, no need to do previous step if the phone wasn't reset.

Terminal

Connecting to SSH

  • Ensure openssh package is installed on Sileo
  • You can then connect to ssh mobile@IP
@p-ja
p-ja / README.md
Last active January 23, 2025 07:23
libffmpeg.so setup for Opera on Linux

How to fix not working videos in Opera on Linux

Assumptions

  • You're using Ubuntu (and maybe other distros using apt and snap)
  • Opera is installed using deb from https://download.opera.com
  • chromium-ffmpeg lib is installed using snap
sudo snap install chromium-ffmpeg
@justjake
justjake / server-preload.js
Last active January 23, 2025 07:20
Customizing NextJS for error reporting and Datadog APM (dd-trace) integration. See https://jake.tl/notes/2021-04-04-nextjs-preload-hack
// @ts-check
"use strict"
/**
* Set up datadog tracing. This should be called first, so Datadog can hook
* all the other dependencies like `http`.
*/
function setUpDatadogTracing() {
const { tracer: Tracer } = require('dd-trace')
const tracer = Tracer.init({
@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active January 23, 2025 07:19
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/rfc9562/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(
@0xdevalias
0xdevalias / _accessing-apple-reminders-data-macos.md
Last active January 23, 2025 07:19
Some notes on accessing / exporting Apple's Reminders data on macOS
.
├── cmd
│   ├── cli
│   └── web
├── internal
│   ├── database
│   ├── request
│   ├── response
│   ├── templatefuncs
│   ├── validator