Skip to content

Instantly share code, notes, and snippets.

View michaeltrainor's full-sized avatar
:octocat:
Riding in a giant-spinning-molten-crust-ball spaceship.

haktwld michaeltrainor

:octocat:
Riding in a giant-spinning-molten-crust-ball spaceship.
View GitHub Profile
@michaeltrainor
michaeltrainor / cheatsheet.ps1
Created December 26, 2023 05:58 — forked from pcgeek86/cheatsheet.ps1
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
@michaeltrainor
michaeltrainor / bezdraw.py
Created June 20, 2022 10:17 — forked from Alquimista/bezdraw.py
Draw Bezier curves using Python and PySide6
#!/usr/bin/env python3
import sys
import math
from PySide6 import QtGui, QtCore, QtWidgets
def binomial(i, n):
"""Binomial coefficient"""
@michaeltrainor
michaeltrainor / treeview_test.py
Created May 19, 2022 20:54 — forked from nbassler/treeview_test.py
PyQt5 TreeView with QAbstractItemModel
"""
Reworked code based on
http://trevorius.com/scrapbook/uncategorized/pyqt-custom-abstractitemmodel/
Adapted to Qt5 and fixed column/row bug.
TODO: handle changing data.
"""
import sys
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@michaeltrainor
michaeltrainor / get-bearer-token-twitter-api
Created August 13, 2020 19:47 — forked from valeriocos/get-bearer-token-twitter-api
Get a bearer token for Twitter application-only requests in Python3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@michaeltrainor
michaeltrainor / profile.ps1
Created July 22, 2020 09:52 — forked from timsneath/profile.ps1
PowerShell template profile: adds some useful aliases and functions
### PowerShell template profile
### Version 1.03 - Tim Sneath <tim@sneath.org>
### From https://gist.github.com/timsneath/19867b12eee7fd5af2ba
###
### This file should be stored in $PROFILE.CurrentUserAllHosts
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following:
### PS> New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force
### This will create the file and the containing subdirectory if it doesn't already
###
### As a reminder, to enable unsigned script execution of local scripts on client Windows,
@michaeltrainor
michaeltrainor / .bash_profile
Created February 6, 2019 13:28 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@michaeltrainor
michaeltrainor / MayaDockingClass.py
Created May 18, 2017 19:30 — forked from liorbenhorin/MayaDockingClass.py
Maya 2017 PySide2 Docking Qt QMainWindow
"""
This is what you need to do in order to get a qt window to dock next to maya channel box,
In all maya versions, including 2017 with PySide2
"""
__author__ = "liorbenhorin@gmail.com"
import sys
import os
import logging
import xml.etree.ElementTree as xml