Skip to content

Instantly share code, notes, and snippets.

oglops / docker-compose.yml
Last active Jan 17, 2022
media library docker compose
View docker-compose.yml
version: "3.8"
x-env-vars: &env-vars
PUID: 1000
PGID: 1000
TZ: Asia/Shanghai
UMASK: 002
x-common-settings: &common-settings
View .gitconfig
name = x
email = x
default = simple
tool = vscode
tool = vscode
[mergetool "kdiff3"]
oglops /
Last active Sep 6, 2021
sync maya script editor tabs among multiple maya sessions
import re
import maya.cmds as mc
import maya.mel as mel
def get_optionvar(var, type='iv'):
pref_file = mc.internalVar(userPrefDir=1)+'userPrefs.mel'
values = []
with open(pref_file) as f:
for line in f.readlines():
oglops / withDigits.user.js
Last active Jul 31, 2021
View withDigits.user.js
// ==UserScript==
// @name withDigit
// @namespace taobao
// @include*
// @version 0.02
// @require
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle("table.crap td { padding:0 5px 0 5px; }");
oglops /
Last active Mar 26, 2021
embed a model panel into script editor with xml attribute editor template in maya 2015
import maya.cmds as cmds
import maya.utils as mutils
def AEaddModelPanelModule( plug, uiLabel, annot):
paneLayoutName = cmds.paneLayout(h=300)
modelPanel = "customModelPanel"
if cmds.modelPanel(modelPanel, q=1, ex=1):
cmds.modelPanel(modelPanel, e=1, p=paneLayoutName)
oglops /
Created Feb 16, 2016
set script editor font for maya
# You can put this inside your
# import maya.utils as mu
# import script_editor_font as SE
# mu.executeDeferred(SE.launchFromCmdWndIcon)
from PyQt4 import QtGui, QtCore
from maya import cmds, mel
import maya.OpenMayaUI as apiUI
import sip
oglops /
Last active Oct 11, 2020
write to and load from yaml file with OrderedDict
#!/usr/bin/env python
# for python newer than 2.7
from collections import OrderedDict
except ImportError:
# use backport from pypi
from ordereddict import OrderedDict
import yaml
oglops / .ctng.config
Last active Jul 14, 2020
config file for crosstools-ng 1.22 with custom uclibc 0.9.33 config file
View .ctng.config
# Automatically generated file; DO NOT EDIT.
# Crosstool-NG Configuration
# Paths and misc options
oglops /
Created Aug 26, 2014
从上方的list widget 拖动到下方的list widget, show checkbox after dropping, spacebar to multi toggle, avoid creating duplicated items in the bottom list widget
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
import sys
import os
class ThumbListWidget(QtGui.QListWidget):
_rows_to_del = []
oglops /
Created Jan 25, 2016
This example was based on existing work by Carson Farmer and Christophe Kibleur, and an example on the SciPres wiki. One aspect not addressed by this prior work is handling of Python's triple-quoted strings, which may span multiple lines; the QSyntaxHighlighter documentation includes an example for C++ comments, but those have different beginnin…
from PyQt4 import QtGui
import syntax
app = QtGui.QApplication([])
editor = QtGui.QPlainTextEdit()
highlight = syntax.PythonHighlighter(editor.document())