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 / 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def crc16(data):
if type(data) is tuple:
data = list(data)
crc_polynom = 0x8408
crc_preset = 0xFFFF
var ids = document.querySelectorAll(".member_id");
var names = document.querySelectorAll(".member_name");
var output = "", length = ids.length;
for(var i=0; i<length; i++){
output += ids[i].innerHTML.slice(1,-1) + ":" + names[i].innerHTML + "\n";
}
console.log(output);
@ygmpkk
ygmpkk / server.py
Created November 22, 2013 05:20
RABBIRMQ
#连接rabbitmq服务器
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='host'))
channel = connection.channel()
#定义队列
channel.queue_declare(queue='test_queue')
channel.queue_bind(exchange='test_exchange',
queue='test_queue',
routing_key='test_route_key')
@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/*