Skip to content

Instantly share code, notes, and snippets.

View ghostoy's full-sized avatar

Cong Liu ghostoy

  • Dolearning.net
  • Shanghai, China
View GitHub Profile
@ghostoy
ghostoy / nw-shim.js
Created November 17, 2015 11:57
NW.js shim for providing backward compatible for NW13
(function() {
// detect `nw` object of NW13
if (!(self.nw && self.nw.require)) return;
var realrequire = nw.require;
self.require = function() {
if (arguments[0] === 'nw.gui') {
return nw;
} else {
@ghostoy
ghostoy / console.js
Created December 18, 2015 06:48
Console in Node context should redirect output to DevTools
exports.log = function(msg) {
console.log(msg);
}
@ghostoy
ghostoy / index.html
Created January 5, 2016 08:10
Post Form
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>form post</title>
</head>
<body>
<form method="POST" action="http://localhost:9999/post.html">
<input type="text" name="myfield" value="myvalue">
@ghostoy
ghostoy / bar.js
Last active December 27, 2021 23:51
test nwjc
console.log('bar');
@ghostoy
ghostoy / led.c
Created May 21, 2019 09:31
Arduino点亮LED灯
const int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT); // 设置13端口为输出
}
void loop() {
digitalWrite(ledPin, HIGH); // 设13端口为高位,让灯亮起来
delay(1000); // 等待1s
digitalWrite(ledPin, LOW); // 设为低位,让灯熄灭
@ghostoy
ghostoy / led-loop.c
Last active May 21, 2019 09:54
Arduino控制3个LED循环亮灭
const int redPin = 13;
const int yellowPin = 12;
const int bluePin = 11;
void setup() {
pinMode(redPin, OUTPUT); // 设置3个LED的端口为输出
pinMode(yellowPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
@ghostoy
ghostoy / full-rgb.c
Last active May 28, 2019 01:10
Arduino控制全彩LED
// 如果是共阳的LED,取消下一行的注释
// #define COMMON_ANODE
const int redPin = A0; // 红色引脚
const int greenPin = A1; // 绿色引脚
const int bluePin = A2; // 蓝色引脚
void setup() {
}
#include <FastLED.h>
// 7个LED灯,如果你的数量不一样改成自己的LED灯数量
#define NUM_LEDS 7
// led控制端口
const int ledPin = 3;
CRGB rainbow[NUM_LEDS] = { CRGB::Red, CRGB::Orange, CRGB::Yellow, CRGB::Green, CRGB::Blue, {0, 0x7f, 0xff}, CRGB::Purple };
CRGB leds[NUM_LEDS];
名称 MathJax KaTex
网址 https://www.mathjax.org/ https://katex.org/
协议 Apache 2.0 MIT
Latex
MathML
化学公式
@ghostoy
ghostoy / math-input.csv
Created December 22, 2019 05:00
数学输入库
名称 MathQuill MathLive WIRIS MathType
网址 http://mathquill.com/ https://mathlive.io/ http://wiris.com/mathtype
协议 MPL 2.0 MIT 商业
Latex
虚拟键盘 有(工具栏)
快捷键
iOS 支持 支持(不显示光标)
化学公式 无(PR)
手写识别
语音朗读