Skip to content

Instantly share code, notes, and snippets.

Jianing Yang jianingy

Block or report user

Report or block jianingy

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
@jianingy
jianingy / falconkit.py
Last active Nov 13, 2018
some handy tools for writing python falcon app
View falconkit.py
# -*- coding: UTF-8 -*-
# author: jianingy.yang@gmail.com
""" Example:
# -*- coding: UTF-8 -*-
from ..common import patch_io # noqa
from ..common import idol
from ..common.falconkit import create_app
from ..model import database
from . import view
@jianingy
jianingy / bitcoin.md
Created Feb 11, 2018
目前的理解
View bitcoin.md

区块链产生的动机

互联网的发展促使人们需要一种电子货币。且电子货币能解决如下问题:

  • 交易安全可靠
  • 有强大的信用背书
  • 不受第三方约束

交易安全可靠

View car32.ino
#include <M5Stack.h>
const int PIN_EA = 1;
const int PIN_I1 = 16;
const int PIN_I2 = 17;
const int CHANNEL_EA = 3;
const int PIN_EB = 3;
const int PIN_I3 = 21;
const int PIN_I4 = 22;
@jianingy
jianingy / uuid.php
Created Sep 3, 2017
simple 96 bits uuid
View uuid.php
<?php
function uuid32() {
return sprintf("%08X", rand(0, pow(2, 32)));
}
function uuid96() {
$uuid = uuid32() . uuid32() . uuid32();
$serial = "";
View ipsec.conf
# client
conn %default
keyexchange=ikev2
authby=secret
conn roadwarrior
type=tunnel
left=192.168.224.186
leftsubnet=192.168.224.186/32[icmp],192.168.224.186/32[gre]
@jianingy
jianingy / remote.yaml
Created Jun 12, 2017
A yaml sample for test purpose
View remote.yaml
---
dependencies:
- hostname && uptime
@jianingy
jianingy / device.rs
Created Feb 21, 2017
Read PM5003 PM2.5 Sensor
View device.rs
// Jianing Yang @ 19 Feb, 2017
use chrono::offset::local::Local;
use errors::*;
use errors::ErrorKind::*;
use models::AirQualityRecord;
use serial;
use serial::prelude::*;
use std::io::prelude::*;
use std::time::Duration;
View gist:f019c22f08a632d05ab3cb29482caa1d
(setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/")
("melpa" . "http://elpa.emacs-china.org/melpa/")))
View background.cpp
/*
* filename : background.cpp
* created at : 2016-10-21 11:28:31
* author : Jianing Yang <jianingy.yang@gmail.com>
*/
#include "background.h"
task_t TASKS[10] = {NULL};
View docker-py-test.py
from __future__ import absolute_import, unicode_literals
from docker import Client as DockerClient
from time import sleep
def run_and_output(cli, c, cmd):
exe = cli.exec_create(c['Id'], cmd=cmd, tty=True)
stream = cli.exec_start(exec_id=exe['Id'], stream=True)
i = 0
You can’t perform that action at this time.