Skip to content

Instantly share code, notes, and snippets.

@KunalGautam
KunalGautam / m5Battery.py
Created September 19, 2019 10:25
M5 Stack Battery Status using MicroPython
from m5stack import *
from m5ui import *
from uiflow import *
import machine
buf = bytearray(1)
CHARGE_100 = '0x00'
CHARGE_75 = '0x80'
CHARGE_50 = '0xC0'
CHARGE_25 = '0xE0'
# Taken from https://forums.aws.amazon.com/thread.jspa?messageID=332091
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
wget http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz
tar -xzf ffmpeg.static.64bit.latest.tar.gz
@marw
marw / read_nova_pm_sensor.py
Last active December 11, 2023 03:40
Get reading from Nova PM Sensor SDS011 (dust sensor, air quality sensor, PM10, PM2,5)
#!/usr/bin/env python3
"""
Get reading from Nova PM Sensor SDS011
(dust sensor, air quality sensor, PM10, PM2,5)
Designed to run from cron and append CSV file.
Script tested using Python3.4 on Ubuntu 14.04.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

Coppied from here: http://apple2.info/wiki/index.php?title=Pinouts#Apple_.2F.2Fe_Motherboard_keyboard_connector
J16 (Numeric Pad) J17 (Keyboard)
11 X5 X6 26 25 Y7
10 X6 SHFT* 24 23 Y6
9 X4 Y9 22 21 X4
8 X7 X3 20 19 X5
7 n/c X1 18 17 X7
6 Y5 X2 16 15 RESET*
5 Y2 XO 14 13 GND
@bishboria
bishboria / springer-free-maths-books.md
Last active April 19, 2026 15:50
Springer made a bunch of books available for free, these were the direct links
@beccadax
beccadax / Example.swift
Last active December 30, 2025 18:15
Elegant handling of localizable strings in Swift. Note: This code is in Swift 2 and would need updates to be used in modern Swift.
let color = "blue"
let num = 42
localized("Colorless green ideas sleep furiously.")
localized("Colorless \(color) ideas sleep furiously.")
localized("\(num.formatted("%05d")) colorless green ideas sleep furiously.")
@phatblat
phatblat / gist:0dd175b406cf2f3fbfc9
Created August 26, 2015 01:22
xcodebuild -exportOptionsPlist available keys (Xcode 7b6)
Available keys for -exportOptionsPlist:
compileBitcode : Bool
For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to YES.
embedOnDemandResourcesAssetPacksInBundle : Bool
For non-App Store exports, if the app uses On Demand Resources and this is YES, asset packs are embedded in the app bundle so that the app can be tested without a server to host asset packs. Defaults to YES unless onDemandResourcesAssetPacksBaseURL is specified.
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active June 15, 2025 17:57
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.