Skip to content

Instantly share code, notes, and snippets.

@oglops
oglops / gist:90ea08309483db07b615
Last active December 22, 2015 02:39
improved maya ref parser
class MayaRefParser(object):
'''
This parses .ma file and get refrenced files info, store them in itself
'''
def __init__(self , maFile=None):
self.header = ''
self.refHeader = ''
self.otherHeader = ''
self.contents = ''
self.contentsLineNum = 0

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@oglops
oglops / simple_treeWidget.py
Last active August 29, 2015 14:05
a simple tree widget used for asking questions
#!/usr/bin/env python2
import os
import sys
import re
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
class TheUI(QtGui.QDialog):
@oglops
oglops / simple tree widget transparent dragging.py
Last active September 7, 2016 14:36
simple tree widget transparent dragging by customizing mouseMoveEvent
#!/usr/bin/env python2
import os
import sys
import re
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
class MyTreeWidget(QtGui.QTreeWidget):
@oglops
oglops / Piratebay IMDB Douban mashup.js
Last active August 29, 2015 14:05
Adds Imdb movie details in thepiratebay(and proxies), an embedded youtube trailer for movies, links to torrentz and torrent file caches, and and douban movie info / reviews
// ==UserScript==
// @name Piratebay IMDB Douban mashup
// @namespace tpb&doubanstyle
// @description Adds Imdb movie details in thepiratebay(and proxies), an embedded youtube trailer for movies, links to torrentz and torrent file caches, and and douban movie info / reviews
// @include /^http://thepiratebay\.(\w\w)/torrent//
// @include /^https://thepiratebay\.(\w\w)/torrent//
// @include http://www.pirateproxy.me/torrent/*
// @include http://pirateproxy.net/torrent/*
// @icon http://i.imgur.com/U1fPU.png
// @version 0.9
@oglops
oglops / doubanMovieSearch.js
Last active October 22, 2015 06:26
search douban movie torrent on torrent project
// ==UserScript==
// @name doubanMovieSearch
// @namespace dbms
// @description search torrent on torrent project
// @include http://movie.douban.com/subject/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 0.3
// ==/UserScript==
var GM_Debug = 1;
@oglops
oglops / record specified window with ffmpeg.sh
Last active August 29, 2015 14:05
record specified window with ffmpeg script by 风入松 qq:896806986
#!/bin/bash
#=========================================================================
# FileName: myrecord.sh
# Desc: -- record my desktop by ffmpeg
# Author: tiglog
# Email: [email protected]
# Version: 1.0
# LastChange: 2013-09-20 20:20:51
#=========================================================================
# Usage: myrecord.sh /path/fo/out.flv
@oglops
oglops / gif-batch-improved
Created August 25, 2014 04:36
add ability to grab window by passing -w
#!/usr/bin/env bash
# the convert call depends on whether you have h264 support in
# convert -list format
# if you don't have it , then record to -vcodec huffyuv
# if you see convert: Not enough pixel data `/tmp/x.avi' @ avi.c/ReadAVIImage/1243.
# maybe try removing -vcodec completely and use uncompressed avi
if [ $# -ne 1 ]; then
@oglops
oglops / gif-batch.sh
Last active August 29, 2015 14:05
用gyfcat来上传 用法 gif-batch.sh -wc 或者 -rc
#!/usr/bin/env bash
# the convert call depends on whether you have h264 support in
# convert -list format
# if you don't have it , then record to -vcodec huffyuv
# if you see convert: Not enough pixel data `/tmp/x.avi' @ avi.c/ReadAVIImage/1243.
# maybe try removing -vcodec completely and use uncompressed avi
if [ $# -ne 1 ]; then
@oglops
oglops / gif-batch-gyfcat-2.sh
Last active August 29, 2015 14:05
用gyfcat来上传 可以指定要存的 gif 文件名
#!/usr/bin/env bash
# the convert call depends on whether you have h264 support in
# convert -list format
# if you don't have it , then record to -vcodec huffyuv
# if you see convert: Not enough pixel data `/tmp/x.avi' @ avi.c/ReadAVIImage/1243.
# maybe try removing -vcodec completely and use uncompressed avi
if [ $# -eq 2 ]; then