Skip to content

Instantly share code, notes, and snippets.

@oglops
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
[user]
name = x
email = x
[push]
default = simple
[diff]
tool = vscode
[merge]
tool = vscode
[mergetool "kdiff3"]
@oglops
oglops / syncScriptEditor.py
Last active Sep 6, 2021
sync maya script editor tabs among multiple maya sessions
View syncScriptEditor.py
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
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; }");
@oglops
oglops / AEaddModelPanel.py
Last active Mar 26, 2021
embed a model panel into script editor with xml attribute editor template in maya 2015
View AEaddModelPanel.py
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)
else:
@oglops
oglops / script_editor_font.py
Created Feb 16, 2016
set script editor font for maya
View script_editor_font.py
# You can put this inside your userSetup.py
# 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
oglops / yaml_OrderedDict.py
Last active Oct 11, 2020
write to and load from yaml file with OrderedDict
View yaml_OrderedDict.py
#!/usr/bin/env python
try:
# for python newer than 2.7
from collections import OrderedDict
except ImportError:
# use backport from pypi
from ordereddict import OrderedDict
import yaml
@oglops
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
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y
#
# Paths and misc options
@oglops
oglops / drag_between_two_list_widgets_check_2_multi.py
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
View drag_between_two_list_widgets_check_2_multi.py
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt, QString
import sys
import os
class ThumbListWidget(QtGui.QListWidget):
_rows_to_del = []
@oglops
oglops / editor.py
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…
View editor.py
# editor.py
from PyQt4 import QtGui
import syntax
app = QtGui.QApplication([])
editor = QtGui.QPlainTextEdit()
highlight = syntax.PythonHighlighter(editor.document())
editor.show()