Skip to content

Instantly share code, notes, and snippets.

View lsongdev's full-sized avatar
👨‍💻

Lsong lsongdev

👨‍💻
View GitHub Profile
#include <EEPROM.h>
#include <SSD1306.h>
#include <ESP8266mDNS.h>
#include <ESP8266SSDP.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#define BTN_UP 12 //GPIO 12 = D6
#define BTN_DOWN 13 //GPIO 13 = D7
#define BTN_OK 14 //GPIO 14 = D5
body {
background: #36393e;
color: #bfbfbf;
font-family: sans-serif;
margin: 0
}
h1 {
font-size: 1.7rem;
margin-top: 1rem;
const fs = require('fs');
const highlight = (src, theme) => {
theme = theme || {
'const' : 35,
'throw' : 35,
'new' : 33,
'var' : 33,
'if' : 36,
'else' : 36,
const fs = require('fs');
const draw = (src, line, column, n) => {
n = n || 3;
const lines = src.split('\n');
const start = Math.max(line - n, 0);
const end = Math.min(lines.length, line + n);
const context = lines.slice(start, end).map((text, i) => {
const curr = start + i + 1;
const out = `${curr} ${text}`;
// http://wiki.sankuai.com/display/DEV/MBTI_Result
var o = $('#main-content').html().match(/[EINSTFJP]{4}/ig).map(x => x.toUpperCase())
.reduce(function(o, x, i, a) {
o[x] = o[x] || {};
o[x].n = (o[x].n || 0) + 1;
o[x].p = ((o[x].n / a.length) * 100).toFixed(2);
return o;
}, {});
#用户名
#rpc-user=user
#密码
#rpc-passwd=passwd
#上面的认证方式不建议使用,建议使用下面的token方式
#设置加密的密钥
#rpc-secret=token
#允许rpc
enable-rpc=true
#允许所有来源, web界面跨域权限需要
$GPVTG,,,,,,,,,N*30
$GPGGA,132403.00,,,,,0,00,99.99,,,,,,*61
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,01,11,,,19*70
$GPGLL,,,,,132403.00,V,N*4D
$GPRMC,132404.00,V,,,,,,,070217,,,N*7E
$GPVTG,,,,,,,,,N*30
$GPGGA,132404.00,,,,,0,00,99.99,,,,,,*66
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,01,11,,,19*70
@lsongdev
lsongdev / iguooo.js
Last active February 8, 2017 02:23
#!/usr/bin/env node
//
// ~$ yarn add superagent cheerio
// ~$ ./iguooo.js > gifs.list
// ~$ cat iguooo.list | awk '{ print $1 }' | wget -Nci -
//
const cheerio = require('cheerio');
const request = require('superagent');
const regexp = /background-image:\s?url\([\'"]?(.[^\'"]+)[\'"]?\)/;
void send_sms(String message, String phone_nr )
{
byte original_byte;
byte newbyte;
int pdu_length;
int counter;
String newphone_nr;
int numlength;
delay(1000);
/*
PduEncoder.cpp - Message PDU format encoder library
Author : Ludovic Laurent.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,