Skip to content

Instantly share code, notes, and snippets.

View ygmpkk's full-sized avatar
😬
No more monkeys jumping on the bed

Timothy ygmpkk

😬
No more monkeys jumping on the bed
  • didi
  • Hangzhou
View GitHub Profile
@ygmpkk
ygmpkk / master.vim
Created February 17, 2014 05:13 — forked from gmccreight/master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@ygmpkk
ygmpkk / Makefile
Created January 28, 2015 01:38
批量编译gitbook和hg pull & update
all:
find . -name '[sS]_[mM]_*' -depth 1 -exec gitbook build {} -o dist/{} \;
dirs = $(shell for file in `find . -name '[sS]_[mM]_*' -depth 1`;do echo $$file; done)
one:
@$(foreach i, $(dirs), cd $(i) && hg pull -u && cd ..;)
clean:
rm -rf ./dist/*
@ygmpkk
ygmpkk / ElasticSearch.sh
Last active September 4, 2015 09:47 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
export VIRTUAL_ENV_DISABLE_PROMPT=1
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="("
ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX=")"
function virtualenv_prompt_info() {
if [ -n "$VIRTUAL_ENV" ]; then
if [ -f "$VIRTUAL_ENV/__name__" ]; then
@ygmpkk
ygmpkk / client.py
Created October 5, 2015 14:51 — forked from mattbennett/client.py
Greenthread worker
import eventlet
eventlet.monkey_patch()
from eventlet.greenpool import GreenPile
from kombu.pools import producers
from kombu import Exchange, Queue
exchange = Exchange('exchange', type='direct')
queue = Queue('queue', exchange, routing_key='queue')
@ygmpkk
ygmpkk / kivy runtime process
Last active December 16, 2015 00:59
kivy程序取样进程
Sampling process 6129 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Python (pid 6129) every 1 millisecond
Process: Python [6129]
Path: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Load Address: 0x103cb9000
Identifier: org.python.python
Version: 2.7.3 (2.7.3)
Code Type: X86-64 (Native)
Parent Process: bash [3188]
@ygmpkk
ygmpkk / gist:5419095
Created April 19, 2013 09:06
python sample
'''
Accordion
=========
.. versionadded:: 1.0.8
.. warning::
This widget is still experimental, and its API is subject to change in a
future version.
@ygmpkk
ygmpkk / console.log
Last active December 16, 2015 16:49
kivy for ios crash lanuch
Apr 26 16:46:27 7suntekizhuantou kernel[0] <Debug>: launchd[416] Builtin profile: container (sandbox)
Apr 26 16:46:27 7suntekizhuantou kernel[0] <Debug>: launchd[416] Container: /private/var/mobile/Applications/46F8871A-A51F-4D34-9D7B-CBCF38D6399B (sandbox)
Apr 26 16:46:27 7suntekizhuantou python-for-ios[416] <Warning>: *** Assertion failure in void UIApplicationInstantiateSingleton(Class)(), /SourceCache/UIKit/UIKit-2380.17/UIApplication.m:2037
Apr 26 16:46:27 7suntekizhuantou python-for-ios[416] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'There can only be one UIApplication instance.'
*** First throw call stack:
(0x31f462a3 0x39de697f 0x31f4615d 0x3281bb13 0x33da279d 0x33da2109 0xf225b 0x3a7ffd 0x32854277 0x31f1b5df 0x31f1b291 0x31f19f01 0x31e8cebd 0x31e8cd49 0x35a562eb 0x33da2301 0x3a7c3b 0x3a21db20)
Apr 26 16:46:28 7suntekizhuantou ReportCrash[417] <Notice>: Formulating crash report for process python-for-ios[416]
Apr 26 16:46:28 7sunteki
@ygmpkk
ygmpkk / words.py
Last active December 20, 2015 05:19
提取文本内容的单词
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import os.path
import re
from collections import OrderedDict
from random import choice
prepared
exclusively
for
kwonjin
jeong
the
world
is
parallel
if