Skip to content

Instantly share code, notes, and snippets.

a:link, a:visited, a:active {
color: #8e8d93;
-webkit-transition: all .15s;
-moz-transition: all .15s;
-ms-transition: all .15s;
-o-transition: all .15s;
transition: all .15s;
}
a.top:link, a.top:visited, a.top:active {
color: #000;
@anson0370
anson0370 / mac_trick.sh
Last active December 18, 2015 18:59
mac秘笈
# 让QuickLook中的文字可以选取-开启和关闭
defaults write com.apple.finder QLEnableTextSelection -bool TRUE;killall Finder
defaults delete com.apple.finder QLEnableTextSelection;killall Finder
# 强制mac字体渲染(非Apple家显示器有效)-设定/删除和查看
defaults -currentHost write -g AppleFontSmoothing -int 3 # 1-3档 轻-重
defaults -currentHost delete -g AppleFontSmoothing
defaults -currentHost read -g AppleFontSmoothing
# 隐藏的app在dock上虚化以区分-开启和关闭
@anson0370
anson0370 / pin.coffee
Created June 10, 2013 07:58
a jquery plugin to pin an element on any element u want
do ($=jQuery) ->
$.fn.pin = (target) ->
$target = if target
if typeof target == "function"
target.apply @
else
$(target)
else
$(@).parent()
@anson0370
anson0370 / JD.md
Last active December 17, 2015 20:29

关于我们

我们是谁

6位前阿里系员工组成的完整团队,从视觉设计到PD以及前/后端开发,团队氛围没羞没臊。

我们做什么

电商解决方案养活自己(咨询和外包)、O2O平台争取发财。

@anson0370
anson0370 / draw_by_commit.rb
Created May 17, 2013 16:33
draw char by commit
require 'date'
author = "Anson"
email = "anson0370@gmail.com"
date = Date.new(2012, 7, 30)
a = %w{
. . . . . .
. o o o . .
o . . . o .

组合接口说明

组合接口将独立的接口组合成一个流程调用,达到一次调用组合多个功能的目的。通过参数biz_id来进行幂等和去重的处理。

taobao.scitem.sample.code.pcs.add

组合三步动作:1. 创建仓储sku;2. 初始化库存;3. 批量建立映射关系。

参数说明

@anson0370
anson0370 / jushita_datasync_usage.md
Created May 23, 2012 06:04
通过SDK来使用数据订阅推送服务 For Java

通过SDK来使用长连接主动推送服务 For Java

概述

现在三方集成的长连接主动推送订阅使用经过简单改造的TOP长连接推送SDK,在使用上有一些和TOP长连接推送区别的地方需要特殊注意,在下面的示例代码中都有体现

  • 使用特殊的Configuration子类来初始化长连接: JushitaConfiguration,该配置类有两点需要注意
    1. 消费线程池被设置为最大1个线程,强制的完全顺序的消费数据
    2. 带有一个abstract的方法public abstract List<String> getTopicInfo();需要实现,通过该方法返回需要订阅的topic信息。该方法在每次连接发起前都会被调用以重新计算topic信息,请在这个方法里携带最新的带offset的topic信息
  • 为保证不丢任何消息,需要做两件事情
@anson0370
anson0370 / ProcessAccessor.java
Created April 16, 2012 06:57
PmcAccessor_interface
/**
* Project: pmc-api
*
* File Created at Apr 1, 2009
* $Id$
*
* Copyright 2009 Taobao.com Corporation Limited.
* All rights reserved.
*
* This software is the confidential and proprietary information of
@anson0370
anson0370 / kongur_quick_start.md
Created January 18, 2012 10:50
quick start of kongur

Quick Start

Dependencies

使用maven管理依赖,最新的PMC版本是2.1.2.11

一个全功能的嵌入式的简单依赖可能是这样的

<properties>

2.1.2.11

@anson0370
anson0370 / core_run.java
Created December 15, 2011 03:58
core run of kongur
private void run(KongurContext context, ActivityNode currentNode, Long processInstanceId, String nodeType,
PvmExecution executor) throws SchedulerException, BizException {
// 如果有流程实例 先更新流程实例 再去做节点内容
// 先select再update 避免mysql中的死锁
if (processInstanceId != null) {
Activity activity = activityDAO.selectFailedByProcessInstanceIdAndActivityName(processInstanceId,
currentNode.getName());
if (activity == null) {
if (nodeType.endsWith(NodeExecutor.NOTIFY_EXECUTOR)) {
// 这种情况允许继续执行 去重在节点的notify执行器中做