Skip to content

Instantly share code, notes, and snippets.

View martian111's full-sized avatar

Martin Lui martian111

  • 03:29 (UTC -07:00)
View GitHub Profile
@Gaurav8757
Gaurav8757 / Suspense.js
Last active September 3, 2024 11:27
A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition. Error: A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that …
startTransition:
1. startTransition is a function in React that is used when you're about to update a particular state and its impact shouldn't heavily affect the UI.
2. Its primary purpose is to ensure that if you're running a long-running process, the user doesn't face significant delays in the UI.
3. It allows React to defer the update, making it non-blocking for the user interface.
Suspense:
@sekcompsci
sekcompsci / Comparison Espressif ESP MCUs.md
Last active September 24, 2024 01:46 — forked from fabianoriccardi/Comparison Espressif ESP MCUs.md
Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6. Forked from @fabianoriccardi

Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families.

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September 2019, September 2020, December
@kennwhite
kennwhite / lxc_v4_notes_feb-2021.txt
Last active October 23, 2021 17:46
LXC v4 notes (2/2021) for Ubuntu
# Good tips here: https://www.cyberciti.biz/faq/install-lxd-on-ubuntu-20-04-lts-using-apt/
# List all running services
systemctl list-units --all --type=service --no-pager | grep running
# Clean install of lxc (on host) - first lxd system, then lxc command line tools
sudo apt-get update
sudo apt-get upgrade
sudo apt install lxd
sudo adduser YOURUSERID lxd # (probably already there)
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active September 22, 2024 11:03
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@katydecorah
katydecorah / email-drafter.js
Last active July 19, 2023 22:06
Draft emails in Gmail from a Google spreadsheet and a Google doc template: https://katydecorah.com/code/google-sheets-to-gmail-template/
// What is the Google Document ID for your email template?
var googleDocId = "abcd0000abcd0000abcd0000abcd0000";
// Which column has the email address? Enter the column row header exactly.
var emailField = 'Email';
// What is the subject line?
var emailSubject = 'You\'re bringing {Type}!';
// Which column is the indicator for email drafted? Enter the column row header exactly.
var emailStatus = 'Date drafted';
/* ----------------------------------- */
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active September 24, 2024 08:02
crack activate Office on mac with license file
@cmur2
cmur2 / my-npt-dhcp6c-script
Last active September 1, 2021 13:51
Script for dhcp6c to handle IPv6 network prefix translation as described in https://blog.altimos.de/2016/11/isolating-your-home-ipv6-network-with-nptv6-on-edgerouter-lite/
#!/bin/bash
INSIDE_PREFIX="fdxx::/64"
OUTSIDE_INTERFACE="eth2"
DUMMY_INTERFACE="dummypd0"
OUTSIDE_PREFIX_FILE="/var/run/my-npt-outside-prefix"
logger -p info -t my-npt "my-npt-dhcp6c-script invoked"
OLD_OUTSIDE_PREFIX=""
@alexcasalboni
alexcasalboni / aws-lambda-edge.md
Last active July 25, 2024 22:45
Serve dynamically generated, minimized and compressed HTML pages with AWS Lambda@Edge.

AWS Lambda@Edge Experiment

Requirements

  • AWS Lambda@Edge (enabled Preview)
  • One Amazon CloudFront Distribution (origin doesn't matter)
  • IAM role (basic execution is enough)
  • npm to install Node.js dependencies
import Foundation
/// NSURLSession synchronous behavior
/// Particularly for playground sessions that need to run sequentially
public extension NSURLSession {
/// Return data from synchronous URL request
public static func requestSynchronousData(request: NSURLRequest) -> NSData? {
var data: NSData? = nil
let semaphore: dispatch_semaphore_t = dispatch_semaphore_create(0)
@ygotthilf
ygotthilf / jwtRS256.sh
Last active September 23, 2024 08:13
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub