Skip to content

Instantly share code, notes, and snippets.

@kamilchm
kamilchm / shell.nix
Created September 17, 2018 12:06
React Native nix-shell
with import <nixpkgs> {};
let
jdk = openjdk;
node = nodejs-10_x;
sdk = androidenv.androidsdk {
platformVersions = [ "23" ];
abiVersions = [ "x86" ];
useGoogleAPIs = true;
useExtraSupportLibs = false;
@iki
iki / .gitignore
Last active May 13, 2021 17:41
Example of using GraphQL API from Micropython with ported Prisma python-graphql-client
# See https://help.github.com/ignore-files/ for more about ignoring files.
# logs
*.log*
# tools settings and other hidden directories
/.*/
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active March 14, 2026 03:25
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@nmz787
nmz787 / machine.py
Last active May 11, 2023 14:07
micropython mock library - for checking syntax of your MicroPython from Linux
class _board(object):
def __getattr__(self, *args, **kwargs):
return 1
from pyb import Pin as Pin
from pyb import I2C as I2C
from stm import mem32, mem16, mem8
@cgawron
cgawron / esp_mqtt_ota.c
Created May 3, 2018 05:16
ESP32 OTA with espmqtt
static void handle_ota(esp_mqtt_event_handle_t event, char *path[], int numComponents)
{
esp_err_t err;
static esp_ota_handle_t update_handle = 0;
if (numComponents < 3)
{
ESP_LOGW(TAG, "too few components");
return;
}
@HodGreeley
HodGreeley / README-Couchbase-Docker.adoc
Last active July 7, 2022 14:42
Docker Scripts to Simplify Setup with Couchbase

Docker Scripts to Simplify Setup with Couchbase

@jugyo
jugyo / Main.js
Last active July 19, 2019 18:57
Model class with PouchDB
export default class User extends Model {
static className = 'User'
}
await User._put({id: 1, name: 'Jugyo'})
await User.get(1) // {className: "User", id: 1, name: "Jugyo", _id: "User-1", _rev: "1-b2d6c93292974cd1b14a786f7576ec53"}

Limitations and pitfalls of @micropython.native

Micropython is fully compatible with Python 3 syntax... except when it isn't.

In this article, we explore one of the "dark corners" of micropython: limitations imposed by @micropython.native decorator.

Documentation on The Native code emitter is brief and a bit vague:

@FreddyPoly
FreddyPoly / Terminal
Last active May 27, 2021 20:03
[REACT NATIVE] Check memory usage of app
Plutôt utiliser l'outil `Profiler` de Android Studio. Les valeurs données sont différentes.
adb shell dumpsys meminfo <package name | pid> [-d]
adb shell dumpsys meminfo com.awesomeproject [-d]
while sleep 1; do adb shell dumpsys meminfo com.cnhrtkapp | grep 'Unknown\|Gfx dev\|TOTAL'; done
@BBBSnowball
BBBSnowball / espminiterm.py
Last active June 10, 2021 11:21
serial monitor for ESP8266, run "pio run -t upload" on ctrl-t ctrl-u, decode stacktraces, paths are hardcoded for platformio with nodemcuv2 board
import serial
from serial.tools import miniterm
import subprocess, sys, re, os
class ESPMiniterm(miniterm.Miniterm):
def handle_menu_key(self, c):
if c == '\x15': # ctrl-u
self.upload_file()
else:
super(ESPMiniterm, self).handle_menu_key(c)