Skip to content

Instantly share code, notes, and snippets.

View dengmin's full-sized avatar
🌴
On vacation

hello_world dengmin

🌴
On vacation
  • Baie Tech
  • HangZhou,China
View GitHub Profile
@martyglaubitz
martyglaubitz / CircleNetworkImageView.java
Last active January 8, 2016 11:59
Circle mask NetworkImageView for Volley
/* The MIT License (MIT)
Copyright (c) 2014, Marty Glaubitz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
{% extends 'base.html' %}
{% import 'macros.html' as macros %}
{% block content %}
<div class="row">
<div class="col-xs-12 col-md-3 col-sm-4 col-sm-offset-4 col-md-offset-4 col-lg-3 col-lg-offset-4">
<div class="login-message">
Login to AwesomeService!
</div>
{% call macros.render_form(form, action_url=url_for('login_view'), action_text='Login',
class_='login-form') %}
@ninehills
ninehills / zerorpc.md
Created June 18, 2013 12:17
ZeroRPC简介 - 轻量级分布式通信框架

ZeroRPC简介 - 轻量级分布式通信框架

概述

分布式系统的核心是分布式通信,而传统上开发一套支持上千台规模集群,可靠性非常高的分布式通信框架,需要不少的精力投入。而在多数情景下,我们(特别是时间宝贵的OP)并不是非常关注技术实现的细节,而是希望有一套成熟、轻量、可靠性高、使用方便而且易于调试的分布式通信框架,可以直接使用,从而把时间放在具体业务逻辑上。

在PyCon 2012大会上,dotcloud公司开源了一套基于ZeroMQ和MessagePack的分布式通信框架(或者说是协议+Python实现)。该框架因为基于ZeroMQ,使用方法是RPC,所以被命名为ZeroRPC。ZeroRPC的特点在其官网的介绍中一目了然[1]:

ZeroRPC is a light-weight, reliable and language-agnostic library for distributed communication between server-side processes.

@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
anonymous
anonymous / Ext.ux.MultiCellSelectionModel.js
Created May 6, 2011 15:01
Multiple cell selection model for the Ext JS grid component.
/**
* Original version by harley.333
* Updated 5/6/2011 by taylorbarstow
*
* FOUND HERE: http://www.sencha.com/forum/showthread.php?53118-Multiple-Cells-Selection-Model
*
* @class Ext.ux.MultiCellSelectionModel
* @extends Ext.grid.AbstractSelectionModel
* Supports multiple selections and keyboard selection/navigation.
* @constructor