Skip to content

Instantly share code, notes, and snippets.

View lemonhall's full-sized avatar

lemonhall lemonhall

View GitHub Profile
last edit: 20140822 15:11
本文分析的代码是 nanomsg-0.4-beta版本。
要创建一个 PUB/SUB 服务,只需要六个 API,分别是:
1. nn_socket
2. nn_bind
3. nn_connect
4. nn_send
5. nn_recv
6. nn_close
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@onlytiancai
onlytiancai / python_infrastructure.md
Created October 12, 2012 08:55
python 基础设施讨论贴

python项目通用组件和基础服务

很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。

每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。

原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。

另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。

@max-mapper
max-mapper / cordova-loader.js
Created August 31, 2012 23:33
phonegap conditional script loader
// require this script before your document is done loading
;(function () {
var isDroid = navigator.userAgent.match(/Android/)
var isiOS = navigator.userAgent.match(/(iPhone|iPod|iPad)/)
var droidScripts = [
"script/cordova-android.js",
"script/android-utils.js",
"script/cdv-plugin-childbrowser-android.js",
"script/cdv-plugin-datepicker.js",

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

@lemonhall
lemonhall / arraybuffer-blob-filereader-localStorage.js
Created July 14, 2012 09:54 — forked from robnyman/arraybuffer-blob-filereader-localStorage.js
Get file as an arraybuffer, create blob, read through FileReader and save in localStorage
// Getting a file through XMLHttpRequest as an arraybuffer and creating a Blob
var rhinoStorage = localStorage.getItem("rhino"),
rhino = document.getElementById("rhino");
if (rhinoStorage) {
// Reuse existing Data URL from localStorage
rhino.setAttribute("src", rhinoStorage);
}
else {
// Create XHR, BlobBuilder and FileReader objects
var xhr = new XMLHttpRequest(),
@Rob--W
Rob--W / installChrome.vbs
Created June 6, 2012 15:20
VB script to automate the installation, configuration and launch of Google Chrome
' Author: Rob W <gwnRob@gmail.com>
' License: Creative Commons 3.0 with attribution
' http://creativecommons.org/licenses/by/3.0/
'
' My own use case:
' For browser-testing purposes, I've set up a Win XP Virtual Machine
' (http://stackoverflow.com/q/10541225). My Chrome installers are
' located in a virtual share, at \\VBOXSRV\WinShared\WinXPDev\Chrome\
' When I need to test an old Chrome version, I launch this script, which
' automatically installs and configures Chrome.