Skip to content

Instantly share code, notes, and snippets.

@oglops
oglops / contextDecorator3.py
Last active May 12, 2017
test classmethod
View contextDecorator3.py
#!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from functools import wraps
import time
class ContextDecorator(object):
_built = False
@oglops
oglops / contextDecorator.py
Last active May 12, 2017
context aware context decorator for maya
View contextDecorator.py
#!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from functools import wraps
import time
class Singleton(ABCMeta):
_instance = None
def __call__(cls, *args, **kwargs):
@oglops
oglops / batch_keys.sh
Created Apr 22, 2017 — forked from ShadowKyogre/batch_keys.sh
Select multiple windows with slop. Needs slop, xwininfo, and xprop. Edit batch_keys.sh if you want to pass different params to the slop wrapper.
View batch_keys.sh
#!/bin/bash
happened=1
for window in $(recsel_windows.py -l -c 0,0.5,1,0.6)
do
happened=0
xdotool windowactivate --sync $window key "$1"
done
if [ $happened -a -n "$2" ];then
@oglops
oglops / mayaCustomMarkers.py
Created Apr 19, 2017 — forked from dgovil/mayaCustomMarkers.py
Allows a user to create custom markers in maya.Based off of this pastebin: http://pastebin.com/Uc8S4QPx (which may further be from createive Crash) and further work by https://github.com/achayan and his pasteBin http://pastebin.com/JGJZ5uu1
View mayaCustomMarkers.py
from PyQt4 import QtGui, QtCore
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
def convertToQT(controlName):
controlPoniter = mui.MQtUtil.findControl(controlName)
if controlPoniter is not None:
return sip.wrapinstance(long(controlPoniter), QtCore.QObject)
View nvidia.patch
diff -ur NVIDIA-Linux-x86_64-375.39/kernel/common/inc/nv-mm.h NVIDIA-Linux-x86_64-375.39.patched/kernel/common/inc/nv-mm.h
--- NVIDIA-Linux-x86_64-375.39/kernel/common/inc/nv-mm.h 2017-01-31 21:50:37.000000000 -0500
+++ NVIDIA-Linux-x86_64-375.39.patched/kernel/common/inc/nv-mm.h 2017-03-29 14:40:57.433472236 -0400
@@ -47,6 +47,8 @@
*/
#if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
+ #include <linux/version.h>
+
#if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
@oglops
oglops / ctng.config
Created Mar 23, 2017
crosstool-ng 1.21 uclibc configuration for shadowsocks-libev on tomato shibby v138
View ctng.config
#
# Automatically generated make config: don't edit
# crosstool-NG 1.21.0 Configuration
# Wed Mar 22 21:55:48 2017
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y
#
@oglops
oglops / .tmux.conf
Created Jan 26, 2017
tmux.conf example
View .tmux.conf
# config example from http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
@oglops
oglops / tmux.cheat
Created Jan 23, 2017 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
View tmux.cheat
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@oglops
oglops / withDigits.user.js
Last active Jul 31, 2021
给天猫评论加入"有数字"的选项,老婆大人专用
View withDigits.user.js
// ==UserScript==
// @name withDigit
// @namespace taobao
// @include https://detail.tmall.com/*
// @version 0.02
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle("table.crap td { padding:0 5px 0 5px; }");