Skip to content

Instantly share code, notes, and snippets.

View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@oglops
oglops / simple_treeWidget.py
Last active Aug 29, 2015
a simple tree widget used for asking questions
View simple_treeWidget.py
#!/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 / gif-batch-improved
Created Aug 25, 2014
add ability to grab window by passing -w
View gif-batch-improved
#!/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 / Piratebay IMDB Douban mashup.js
Last active Aug 29, 2015
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
View Piratebay IMDB Douban mashup.js
// ==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 / record specified window with ffmpeg.sh
Last active Aug 29, 2015
record specified window with ffmpeg script by 风入松 qq:896806986
View record specified window with ffmpeg.sh
#!/bin/bash
#=========================================================================
# FileName: myrecord.sh
# Desc: -- record my desktop by ffmpeg
# Author: tiglog
# Email: tiglog@126.com
# Version: 1.0
# LastChange: 2013-09-20 20:20:51
#=========================================================================
# Usage: myrecord.sh /path/fo/out.flv
@oglops
oglops / gif-batch-gyfcat-2.sh
Last active Aug 29, 2015
用gyfcat来上传 可以指定要存的 gif 文件名
View gif-batch-gyfcat-2.sh
#!/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
@oglops
oglops / gif-batch.sh
Last active Aug 29, 2015
用gyfcat来上传 用法 gif-batch.sh -wc 或者 -rc
View gif-batch.sh
#!/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 / simple_treeWidget_mute_drag_indicator.py
Created Aug 25, 2014
simple tree widget hide dragging indicator by customizing startDrag method
View simple_treeWidget_mute_drag_indicator.py
#!/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 / simple_treeWidget_delegate_dropEvent.py
Last active Aug 29, 2015
use delegate to draw a line under currently pointed row item while dragging, also make item expanded after dropping, after dropping hide the line
View simple_treeWidget_delegate_dropEvent.py
#!/usr/bin/env python2
import os
import sys
import re
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
class MyDelegate(QtGui.QStyledItemDelegate):
@oglops
oglops / simple_treeWidget_mute_drag_indicator_by_mouseMoveEvent.py
Created Aug 25, 2014
simple tree widget hide dragging indicator by reimplementing mouseMoveEvent method
View simple_treeWidget_mute_drag_indicator_by_mouseMoveEvent.py
#!/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):