Skip to content

Instantly share code, notes, and snippets.

View depate's full-sized avatar

Patrik Tesarik depate

View GitHub Profile
@embano1
embano1 / client.go
Last active April 11, 2024 13:46
gRPC Graceful Shutdown on Client and Server
package main
import (
"context"
"grpc-tutorial/greeter"
"io"
"log"
"os"
"os/signal"
"sync"

PineTime Challenge: Unbundling Watch Apps from PineTime OS Firmware

Our PineTime Application Firmware bundles the Watch App together with the operating system (Mynewt OS). If PineTime were a real consumer gadget like an Android phone, we would expect the Watch App to be flashed separately from the operating system.

How can we unbundle Watch Apps from Mynewt OS on PineTime?

This can be done in the Rust Wrappers for Mynewt OS. Right now we auto-generate Rust Wrappers for every Mynewt OS API, via a bindgen script and a Rust Procedural Macro safe_wrap.

Rust Wrappers are needed so that our Rust Application and Driver Code may safely call Mynewt OS functions (written in C). [More details here](https://medium.com/@ly.lee/safer-simpler-

@Mikuana
Mikuana / remove_user_packages.R
Created March 2, 2017 00:31
Remove all user installed packages from R
# Shamlessly stolen from:
# https://www.r-bloggers.com/how-to-remove-all-user-installed-packages-in-r/
# create a list of all installed packages
ip <- as.data.frame(installed.packages())
head(ip)
# if you use MRO, make sure that no packages in this library will be removed
ip <- subset(ip, !grepl("MRO", ip$LibPath))
# we don't want to remove base or recommended packages either\
ip <- ip[!(ip[,"Priority"] %in% c("base", "recommended")),]