This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.25) | |
project(sqlite_example) | |
set(CMAKE_CXX_STANDARD 20) | |
find_package(SQLite3 REQUIRED) | |
add_executable(${PROJECT_NAME} main.cpp) | |
target_link_libraries(${PROJECT_NAME} PRIVATE ${SQLite3_LIBRARIES}) | |
target_include_directories(${PROJECT_NAME} PRIVATE ${SQLite3_INCLUDE_DIRS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cache/ | |
node_modules/ | |
public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::process; | |
fn get_parent_pid(pid: u32) -> Vec<u32> { | |
let mut pids: Vec<u32> = Vec::new(); | |
// ps -o ppid=66393 | |
let ret = process::Command::new("ps") | |
.arg("-o") | |
.arg(format!("ppid={}", pid)) | |
.output(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
I don't recommend using this but it was just exploring an idea of automatically adding widgets | |
""" | |
import sys | |
import inspect | |
from PyQt5 import QtWidgets | |
class ActiveParent(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do some setup for Maya's Qt | |
set(QT_VERSION_MAJOR 5) | |
# Set moc Path | |
set(QT_MOC_EXECUTABLE ${MAYA_BIN_PATH}/moc) | |
add_executable(Qt5::moc IMPORTED) | |
set_target_properties(Qt5::moc PROPERTIES IMPORTED_LOCATION ${QT_MOC_EXECUTABLE}) | |
set(CMAKE_AUTOMOC TRUE) | |
# Set the UIC Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spam | |
def goodbye(name): | |
print("Goodbye {0}".format(name)) | |
if __name__ == '__main__': | |
print(spam.abc) | |
spam.greet('Dan') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from maya import cmds as mc | |
import urllib2 | |
import os | |
import zipfile | |
import shutil | |
def downloadRelease(): | |
userTmpDir = mc.internalVar(userTmpDir=True) | |
dest = os.path.join(userTmpDir, 'simplex.zip') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# -*- coding: utf-8 -*- | |
# Copyright (c) 2011 Sebastian Wiesner <[email protected]> | |
# Modifications by Charl Botha <[email protected]> | |
# * customWidgets support (registerCustomWidget() causes segfault in | |
# pyside 1.1.2 on Ubuntu 12.04 x86_64) | |
# * workingDirectory support in loadUi | |
# found this here: | |
# https://github.com/lunaryorn/snippets/blob/master/qt4/designer/pyside_dynamic.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First lets import our Maya command library | |
from maya import cmds | |
# Then we import our file. In this case I'm using a hardcoded value | |
# But notice the returnNewNodes parameter that tells it to give us back any imported nodes | |
# This may contain nodes we don't want | |
# So we'll need to shorten it down | |
nodes = cmds.file('C:/Users/dhruv/Documents/maya/controllerLibrary/bigdonut.ma', | |
i=True, returnNewNodes=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First lets import the two modules we'll need from Qt | |
from Qt import QtWidgets, QtCore | |
# Then we create our Window class, in this case from a QDialog | |
class MyWindow(QtWidgets.QDialog): | |
def __init__(self): | |
# We use the __init__ method to initialize it | |
# The super function gets the class we are inheriting from (in this case QDialog) and calls its' __init__ as well |
NewerOlder