Skip to content

Instantly share code, notes, and snippets.

View plucury's full-sized avatar

plucury plucury

  • AriesApp
  • Chengdu, China
View GitHub Profile
@plucury
plucury / gist:3009512
Created June 28, 2012 06:33
美化git日志展示
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@plucury
plucury / gist:5699234
Last active December 18, 2015 00:49
Transcode
ffmpeg -i /Users/plucury/tmp/transcode/video/s.mov -vcodec libx264 -vprofile high -preset slow -b:v 500k -acodec libfaac -ab 128k -ac 2 -vf "scale=iw*min(640/iw\,360/ih):ih*min(640/iw\,360/ih),pad=640:360:(640-iw)/2:(360-ih)/2,transpose=1" -map_metadata -1 output.mp4
ffmpeg -i /Users/plucury/tmp/s.mov -vcodec libvpx -preset slow -b:v 800k -acodec libvorbis -ab 128k -ac 2 -vf "scale=iw*min(640/iw\,360/ih):ih*min(640/iw\,360/ih),pad=640:360:(640-iw)/2:(360-ih)/2,transpose=1" -map_metadata -1 output.webm
./configure --enable-gpl \
--enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora \
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --enable-libfaac --extra-libs="-ldl"
@plucury
plucury / gist:6914247
Last active December 25, 2015 03:59
hs_err_pid24688
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002aaab833b342, pid=24688, tid=1093589312
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libzmq.so.3+0x27342] zmq::socket_base_t::check_tag()+0x2
#
function displayMyData (data, chinese) {
$('.ajaxLoader').hide();
$('.headerRight').html(data.user.name);
var params = {
username: data.user.name
}
_.extend(params, data.global);
if (data.user.stats.length < 1) {
params.personalHours = 0;
19:09:32.129 [main] ERROR io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 2
#2:
io.netty.buffer.AdvancedLeakAwareByteBuf.toString(AdvancedLeakAwareByteBuf.java:675)
io.netty.handler.codec.stomp.StompSubframeDecoderTest.testSingleFrameWithBodyWithoutContentLength(StompSubframeDecoderTest.java:81)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
@plucury
plucury / main.py
Last active August 29, 2015 14:06
Interview Code
# -*- coding:utf-8 -*-
__author__ = 'XU ZHANGXUAN'
# This method should be pre-defined
def is_include(name1, name2):
pass
class Node(object):
@plucury
plucury / gist:84f600640593a3e3eae8
Created September 22, 2015 07:49
Delete trailing white space on save
" Delete trailing white space on save, useful for Python ;)
augroup DeleteTrailing
autocmd BufWrite *.py :call DeleteTrailingWS()
augroup END
" Delete trailing whitespaces
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
--- code/stock » python analyze.py
2010-01-01 2010-12-31
buy 2010-01-06 19.35 17.36
sell 2010-01-12 18.61 17.07
buy 2010-01-13 18.03 16.15
sell 2010-01-14 17.52 16.33
buy 2010-01-15 18.33 16.31
sell 2010-01-18 17.43 16.18
buy 2010-02-01 16.82 15.29
sell 2010-02-05 16.69 15.48
{
"RequestId": "FD55C8DE-B87A-4B13-9577-0BA2480F6403",
"MonitorData": {
"InstanceMonitorData": [{
"IOPSRead": 0,
"IntranetBandwidth": 0,
"BPSWrite": 0,
"IntranetTX": 0,
"IntranetRX": 0,
"InstanceId": "i-250vgbzl7",
marks = {'a': '0', 'b': '1'}
def transfer(code):
i = 0
binary = ''
while i < len(code):
cnt = ''
while code[i].isdigit():
cnt += code[i]
i += 1