Skip to content

Instantly share code, notes, and snippets.

# main.py -- put your code here!
import pyb
# a scheduler class, to schedule and run events after a delay
class Scheduler:
def __init__(self):
# begin with no events
self.events = []
# after the delay, run the function
@yoyicue
yoyicue / change.py
Last active August 29, 2015 14:03
RG-BLE-12 模块的 AT 指令封装
#!/usr/bin/env python
#coding=utf-8
import serial
import time
class BLEPrinter(object):
SERIALPORT = '/dev/tty.usbserial-AM021OAT'
BAUDRATE = 9600
@yoyicue
yoyicue / dump.c
Last active January 2, 2016 18:49
get all key/value in redis DB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hiredis.h"
int main(void)
{
unsigned int i,j=0;char **str1;
redisContext *c; char *t;
redisReply *reply, *rep;
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@yoyicue
yoyicue / autoclean.db
Created November 4, 2012 07:00
deluge control script - wyr888
{}
@yoyicue
yoyicue / reltool.conf
Created September 28, 2012 06:45
reltool.conf for erlang baiduhi client
{sys, [
{lib_dirs, ["../apps","../deps"]},
{erts, [{mod_cond, derived}, {app_file, strip}]},
{app_file, strip},
{rel, "baiduhi", "1",
[
baiduhi,
kernel,
stdlib,
sasl,