Skip to content

Instantly share code, notes, and snippets.

View martian111's full-sized avatar

Martin Lui martian111

  • 17:23 (UTC -07:00)
View GitHub Profile
@sekcompsci
sekcompsci / Comparison Espressif ESP MCUs.md
Created June 18, 2021 03:56 — forked from fabianoriccardi/Comparison Espressif ESP MCUs.md
Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

Comparison 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 May 28, 2024 11:46
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 May 30, 2024 12:19
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 September 8, 2023 08:44
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 May 29, 2024 12:27
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
@danawoodman
danawoodman / 1-react-websockets-reflux.md
Last active September 15, 2021 14:48
Using WebSockets with Reflux and React

WebSockets + Reflux + React

Using WebSockets, React and Reflux together can be a beautiful thing, but the intial setup can be a bit of a pain. The below examples attempt to offer one (arguably enjoyable) way to use these tools together.

Overview

This trifect works well if you think of things like so:

  1. Reflux Store: The store fetches, updates and persists data. A store can be a list of items or a single item. Most of the times you reach for this.state in react should instead live within stores. Stores can listen to other stores as well as to events being fired.
  2. Reflux Actions: Actions are triggered by components when the component wants to change the state of the store. A store listens to actions and can listen to more than one set of actions.