Skip to content

Instantly share code, notes, and snippets.

View yoursunny's full-sized avatar
📟

Junxiao Shi yoursunny

📟
View GitHub Profile
@yoursunny
yoursunny / boost-info-20200603.tgz
Last active June 4, 2020 00:39
boost-info package
@yoursunny
yoursunny / get-pip.py
Created January 21, 2020 14:56
copy of https://bootstrap.pypa.io/get-pip.py retrieved on 2020-01-21
This file has been truncated, but you can view the full file.
#!/usr/bin/env python
#
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version 19.3.1).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
@yoursunny
yoursunny / ndn-fch.worker.js
Last active December 26, 2019 03:08
NDN-FCH on Cloudflare Workers https://ndn-fch.yoursunny.workers.dev/
const IPGEOLOCATION_IO_APIKEY = "INSERT-APIKEY-HERE";
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request))
});
async function getGeoLocation(ip) {
const url = new URL("https://api.ipgeolocation.io/ipgeo");
url.searchParams.set("apiKey", IPGEOLOCATION_IO_APIKEY);
url.searchParams.set("ip", ip);
@yoursunny
yoursunny / halloween2019.ino
Last active October 30, 2019 02:17
Halloween 2019 ODROID-GO sketch
/*
Halloween 2019 ODROID-GO sketch
- press A button: draw pumpkin with random color
- press B button: draw pumpkin with realistic color
- press MENU button: display QR code of source code link
*/
#include <odroid_go.h>
.nyc_output
coverage
node_modules
package-lock.json
@yoursunny
yoursunny / bpi-r2-sdimage.sh
Created August 27, 2019 11:41
OpenWrt 18.06.4 SD eMMC image for Banana Pi R2
#!/bin/bash
# OpenWrt 18.06.4 for Banana Pi R2
# Make SD or eMMC image from official kernel and rootfs images.
# Inspired by https://github.com/BPI-SINOVOIP/openwrt/commit/b4dfaeca4d33ad88364bfb7df353b3dfca2883fe
set -e
KIND=$1
if [[ $KIND != sd ]] && [[ $KIND != emmc ]]; then
echo Usage: $0 '<sd|emmc> [outfile]' >/dev/stderr
@yoursunny
yoursunny / EmojiTetra.ino
Last active February 24, 2021 14:15
Watch @EmojiTetra Live on ESP32 OLED Display https://yoursunny.com/t/2018/EmojiTetra-OLED/
// Watch @EmojiTetra Live on ESP32 OLED Display
// https://yoursunny.com/t/2018/EmojiTetra-OLED/
#include <HTTPClient.h>
#include <U8g2lib.h> // https://github.com/olikraus/U8g2_Arduino/tree/e4178df6b8c69f1880d6d44719a286540e9e94a5
#include <WiFi.h>
const char* WIFI_SSID = "my-wifi";
const char* WIFI_PASS = "my-password";
#include "KeyInWifi.hpp"
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <WiFi.h>
#include <WString.h>
#include <U8x8lib.h>
#define DELAY_CHOICE 250
// https://yoursunny.com/t/2018/PacketDump/
#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";