Skip to content

Instantly share code, notes, and snippets.

/**
* Sample of serverside generation of Highcharts using an extension to jsdom in node.js.
*
* Usage:
* npm install jsdom
* npm install highcharts
* node highcharts-jsdom
*/
/* eslint-env node */
@denghongcai
denghongcai / ReactJS-Server-Side-Rendering.md
Created February 13, 2017 16:34 — forked from koistya/ReactJS-Server-Side-Rendering.md
Server-side Rendering (SSR) for ReactJS / Flux Applications. Setting document.title

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)
@denghongcai
denghongcai / diff.mdown
Created September 18, 2016 16:04 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.

@denghongcai
denghongcai / osx_dmg_package
Created June 21, 2016 04:26 — forked from 44510/osx_dmg_package
mac osx 程序自动打包为 dmg 文件的脚本
set -e
title='千尋影視' # dmg 文件 mount 了之后在文件系统中显示的名称
background_picture_name='mac-dmg-bg.png' # dmg 文件在 mount 了之后界面中显示的背景图片路径
application_name='千尋影視.app' # 应用程序的名称
# Developer ID 证书的名称(名字的一部分即可,但是需要能在 Keychain Access 中唯一定位到该证书)
developer_id='Developer ID Application: Shanghai Truecolor Multimedia'
# dmg 窗口相关的一些设置,需要根据实际情况做变更
window_left=200 # 窗口位置的 x 坐标

###预备条件

  1. BIOS 升级至 2.15,开启 ACHI,启用 F12 选择启动项
  2. GPT 分区,UEFI 引导的 win8.1 系统
  3. 预留最小约 40GB 磁盘空间,且未格式化
  4. 无线网卡是AR9287

###制作安装U盘

  1. 下载远景论坛U盘版.10.9.2.13C64.20140303.dmg并使用TransMac刻录到U盘
  2. 拔插U盘,删除EFI文件
  3. 拷贝此处提供的EFI文件至刚才位置
(function() {
var path = require('path'), fs = require('fs');
function walk(uri,filter,tree) {
var node = {
name : null,
children : [],
pNode : null,
};
<?php
$data = array(
array('Mon',30,'title a','link a'),
array('Tue',15,'title b','link b'),
array('Wed',40,'title c','link c'),
array('Thu',25,'title d','link d'),
array('Fri',50,'title e','link e'),
array('Sat',35,'title f','link f'),
array('Sat',35,'title f','link f'),
array('Mon',20,'title a','link h')