Skip to content

Instantly share code, notes, and snippets.

Junxiao Shi yoursunny

Block or report user

Report or block yoursunny

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yoursunny /
Created Aug 27, 2019
OpenWrt 18.06.4 SD eMMC image for Banana Pi R2
# OpenWrt 18.06.4 for Banana Pi R2
# Make SD or eMMC image from official kernel and rootfs images.
# Inspired by
set -e
if [[ $KIND != sd ]] && [[ $KIND != emmc ]]; then
echo Usage: $0 '<sd|emmc> [outfile]' >/dev/stderr
yoursunny / EmojiTetra.ino
Last active Jun 12, 2018
Watch @EmojiTetra Live on ESP32 OLED Display
View EmojiTetra.ino
// Watch @EmojiTetra Live on ESP32 OLED Display
#include <HTTPClient.h>
#include <U8g2lib.h> //
#include <WiFi.h>
const char* WIFI_SSID = "my-wifi";
const char* WIFI_PASS = "my-password";
View KeyInWifi.cpp
#include "KeyInWifi.hpp"
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <WiFi.h>
#include <WString.h>
#include <U8x8lib.h>
#define DELAY_CHOICE 250
View PacketDump.ino
#include <cassert>
#include <ESP8266WiFi.h>
#include <lwip/netif.h>
// #include <user_interface.h>
#include "PacketParser.hpp"
const char* WIFI_SSID = "my-ssid";
const char* WIFI_PASS = "my-pass";
yoursunny /
Created Feb 14, 2017
git cherry-pick a feature branch on top of current HEAD
# This script cherry-picks the top commit of a feature branch onto the current HEAD.
# It is designed to work with NDN Gerrit
# This script should be placed outside of the repository directory.
# Suppose your repository looks like:
# A---B---C <== master
# \
# \-D <== feature1
# After checking out master, executing `../ feature1` gives you:
# A---B---C <== master
View readvertise.hpp
// NFD-RIB readvertise feature
/** \brief reference to a RIB route
struct RibRouteRef
shared_ptr<RibEntry> entry;
RibEntry::const_iterator route;
yoursunny / ImageMoveToClick.pde
Created Sep 1, 2016
move image to clicked position (Processing 3)
View ImageMoveToClick.pde
PImage img;
int curX, curY;
int dstX, dstY;
void setup()
size(600, 600);
curX = dstX = width / 2;
curY = dstY = height / 2;

nfdc interactive design

This document proposes a new design for nfdc command which combines existing nfdc and nfd-status commands, as a unified command for monitoring and controlling NFD.

operation modes

nfdc has three operation modes.

one-shot mode executes a single command. An example interaction looks like:

View wsface.htm
<!doctype html>
<title>WebSocketTransport FaceScope test</title>
<input id="btn127" type="button" value="">
<input id="btn1" type="button" value="::1">
<script src=""></script>
var face;
function openFace(host) {
View pwrstat.c
// gcc -o pwrstat pwrstat.c
// display C.H.I.P power and battery status
// AXP209-internal-temperature USB-voltage USB-current battery-voltage [+-]battery-current
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdlib.h>
You can’t perform that action at this time.