Skip to content

Instantly share code, notes, and snippets.

View maxbbn's full-sized avatar

maxbbn maxbbn

View GitHub Profile
@maxbbn
maxbbn / color-transform.js
Created November 23, 2017 01:57
rgb to rgbw transform
// Author baixin.zhao@rokid
exports.rgb2hsv = function (rgb) {
let R, G, B, H, S, V;
R = (rgb >> 16) & 0xFF;
G = (rgb >> 8) & 0xFF;
B = rgb & 0xFF;
@maxbbn
maxbbn / Gruntfile.js
Last active December 20, 2015 13:09
Kissy Pie to Cake
var path = require('path');
var fs = require('fs');
module.exports = function(grunt) {
var fromEncoding = 'utf8';
if (fs.existsSync('fb.json')) {
fromEncoding = JSON.parse(fs.readFileSync('fb.json', 'utf8')).charset;
}
@maxbbn
maxbbn / canvas_line_chart_simple.html
Created June 16, 2012 05:54
simple canvas line chart
<!doctype html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
(function () {
function getPoints(data) {
var points = [];
@maxbbn
maxbbn / front-structure.md
Created April 13, 2012 07:54
前端的目录

时间戳目录

- app
	- page1
		- 1.0
			js
			css
			test
 + 2.0
@maxbbn
maxbbn / autoproxy.pac
Created March 25, 2012 08:58
autoproxy file
/*
* Proxy Auto-Config file generated by autoproxy2pac
* Rule source: http://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
* Last update: Sun, 08 Jan 2012 08:58:04 GMT
*/
function FindProxyForURL(url, host) {
var PROXY = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080";
var DEFAULT = "DIRECT";
//-- AUTO-GENERATED RULES, DO NOT MODIFY!
@maxbbn
maxbbn / build.xml
Created March 15, 2012 06:50
convert charset from utf-8 to gbk
<project name="shop rate build" default="build" basedir=".">
<target name='convert'>
<copy file="source.js" todir="target.js" encoding='utf-8' outputencoding='gbk' />
</target>
</project>