Skip to content

Instantly share code, notes, and snippets.

View davidas13's full-sized avatar
🎯
Learn for life! 🧬 Don't rely on Magic ✨

David Satrio davidas13

🎯
Learn for life! 🧬 Don't rely on Magic ✨
View GitHub Profile
@pboucher
pboucher / shotgunWrapTest.py
Created February 18, 2011 23:19
Experimenting extending Shotgun to return custom objects instead of simple dicts.
import pprint
import sys
import shotgun_api3 as sg
class Shotgun(sg.Shotgun):
__registry = {}
def __init__(self, *args, **kwargs):
super(Shotgun, self).__init__(*args, **kwargs)
@pksunkara
pksunkara / config
Last active January 4, 2026 22:00
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
# vi: ft=dosini
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[column]
@kirpit
kirpit / bash.py
Last active March 17, 2023 06:29
Enables to run subprocess commands in a different thread with TIMEOUT option!
#! /usr/bin/env python
import threading
import subprocess
import traceback
import shlex
class Command(object):
"""
Enables to run subprocess commands in a different thread with TIMEOUT option.
@justinfx
justinfx / modelPanelPyQt4.py
Last active September 15, 2023 03:31
Mixing PyQt4 and Maya UI objects
from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
class MyDialog(QtGui.QDialog):
@turicas
turicas / attrdict.py
Created December 22, 2011 16:21
Python class with dict-like get/set item
#!/usr/bin/env python
# coding: utf-8
class AttrDict(object):
def __init__(self, init=None):
if init is not None:
self.__dict__.update(init)
def __getitem__(self, key):
return self.__dict__[key]
@c0ldlimit
c0ldlimit / git_newrepo
Created November 16, 2012 17:14
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
@durden
durden / pyqtsignal_decorator_connection.py
Created April 4, 2013 13:31
Example of using pyqtSignal.connect as a decorator for slot connection
# Example modified from:
# http://pysnippet.blogspot.com/2010/06/qsignalmapper-at-your-service.html
#
# Example showing how QSignalMapper can be used to manage an arbitrary
# numbers of parameterless signals and re-emit them with an argument
# identifying the sender.
#
# Each signal is associated in the QSignalMapper with either an int,
# QString, QObject or a QWidget which is passed as argument to the slot
@tuankma
tuankma / linux_shortcut
Last active August 21, 2022 21:53
Create a shortcut application in Linux
sudo gedit /usr/share/applications/eclipse.desktop
Content :
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
@LuqueDaniel
LuqueDaniel / PyQt_custom_context_menu.py
Last active September 20, 2021 20:15
PyQt custom context menu
# -*- coding: utf-8 -*-
#PyQt4.QtGui imports
from PyQt4.QtGui import QApplication
from PyQt4.QtGui import QMainWindow
from PyQt4.QtGui import QTextEdit
from PyQt4.QtGui import QMenu
from PyQt4.QtGui import QCursor
#PyQt4.QtGui imports
@rbonvall
rbonvall / redirect.py
Created April 4, 2014 20:36
Redirect both stdin and stdout of a process to a PyQt text edit.
from PyQt4 import QtGui, QtCore, uic
def p(x):
print x
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QWidget.__init__(self)
uic.loadUi('redirect.ui', self)