Skip to content

Instantly share code, notes, and snippets.

Kai Zhang dexbol

Block or report user

Report or block dexbol

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
View cmshow.md
1.获取用户昵称方法 cmshow.getUserNickname()

这个应该不需要。

2.判断是否登录豹来电		cmshow.hasLogin()

这个也不需要

3.调取登录弹窗		cmshow.Login()

没问题

4.跳转支付页面		cmshow.toPay()
@dexbol
dexbol / jMarquee-example.html
Last active Nov 3, 2017
jMarquee - jquery plugin can select polygon marquee in canvas
View jMarquee-example.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="http://vj0.6rooms.com/csjs/lib/tools/jquery/jquery-1.8.0.js"></script>
<script type="text/javascript" src="jMarquee.js"></script>
<style type="text/css">
canvas {
float: left;
}
View redux-register.js
var reducerShape = {};
var makeFinalStateByReducerShape = function(shape, path, result, state,
action) {
if (typeof shape === 'function') {
var obj = result;
var value = state;
for (var i = 0; i < path.length - 1; i++) {
var key = path[i];
View daemon.py
import os
import subprocess
import logging
import argparse
''' Make a python script as daemon.
Usage:
python daemon.py start|stop|restart
You can use this for some scenes such as subversion hooks or init.d
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>html page</title>
</head>
<body>
<form>
userfile: <input type="file" /> <br />
<progress max="100" value="0"></progress> <br />
@dexbol
dexbol / gist:5324980
Created Apr 6, 2013
Cross document message
View gist:5324980
Boom.add('xstream', function(C) {
var TICKET = 'any random string 1';
var PING = 'any random string 2';
var PING_BACK = 'any random string 3';
var host = location.protocol + '//' + location.host +
(location.port ? ':' + location.port : '');
var $ = jQuery;
var win = window;
View sync.py
# coding=utf-8
''' svn post-commit hook. checkout the repository and synchronizate to the
working copy. you can add some feature that you demand, e.g. after all, restart
your web server persuades the code changes to take effect.
'''
import os
import logging
import sys
@dexbol
dexbol / gist:3760062
Created Sep 21, 2012
add commas to integer
View gist:3760062
function addComma(num) {
num = String(num);
var len = num.length;
var remainder = len % 3;
var h = num.substring(0, remainder);
var str = num.substring(remainder);
var i = 0;
var flag = str.length / 3;
var result = h ? [h] : [];
for (; i <f lag; i ++) {
You can’t perform that action at this time.