Skip to content

Instantly share code, notes, and snippets.

View atupal's full-sized avatar

kangle yu atupal

View GitHub Profile
@atupal
atupal / flask-socketio-demo.py
Created July 6, 2013 18:35
flask-socketio-demo
from flask import Flask, request, send_file
from werkzeug.wsgi import SharedDataMiddleware
from gevent import monkey; monkey.patch_all()
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
from socketio.mixins import BroadcastMixin, RoomsMixin
import os
@atupal
atupal / bashrc
Created July 9, 2013 12:51
my bashrc config file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@atupal
atupal / linux_dump_text_to_hex
Created July 14, 2013 14:02
linux下将文件转化为16进制。
linux中有多种方式可以将文件dump成16进制显示,也可以将16进制值再反向成文件。
$ hexdump test.txt
0000000 524f 2d41 3030 3036 0a30 524f 2d41 3030
0000010 3630 0a30
0000014
$ od -x test.txt
0000000 524f 2d41 3030 3036 0a30 524f 2d41 3030
0000020 3630 0a30
0000024
@atupal
atupal / README.md
Created August 19, 2013 06:31 — forked from rkirsling/LICENSE

Click in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.

When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.

To see this example as part of a larger project, check out Modal Logic Playground!

@atupal
atupal / new_gist_file
Created September 5, 2013 02:06
thrift server generate sh
ls | sed 's/hbase-\(.*\)\.cfg/\1/p' -n | awk -v cnt=9091 '{printf("(%s|localhost:%s),", $1, cnt); cnt++;}'
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is free to use by anyone (MIT, blabla).
// Author: [email protected]
var timeouts = {};
var intervals = {};
@atupal
atupal / github.css
Created November 15, 2013 17:25 — forked from theconektd/github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@atupal
atupal / gh-like.css
Created November 15, 2013 17:26 — forked from somebox/gh-like.css
/*
Some simple Github-like styles, with syntax highlighting CSS via Pygments.
*/
body{
font-family: helvetica, arial, freesans, clean, sans-serif;
color: #333;
background-color: #fff;
border: none;
line-height: 1.5;
margin: 2em 3em;
@atupal
atupal / python_resources.md
Created December 12, 2013 07:06 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@atupal
atupal / css_resources.md
Created December 12, 2013 07:06 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides