Skip to content

Instantly share code, notes, and snippets.

@oglops
oglops / contextDecorator3.py
Last active May 12, 2017 07:44
test classmethod
#!/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 07:42
context aware context decorator for maya
#!/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 April 22, 2017 20:09 — 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.
#!/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 April 19, 2017 21:44 — 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
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)
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 March 23, 2017 06:34
crosstool-ng 1.21 uclibc configuration for shadowsocks-libev on tomato shibby v138
#
# 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 January 26, 2017 02:34
tmux.conf example
# 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 January 23, 2017 17:39 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
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 April 16, 2023 01:32
给天猫评论加入"有数字"的选项,老婆大人专用
// ==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; }");