Skip to content

Instantly share code, notes, and snippets.

View Ahuge's full-sized avatar
🏡
Remote

Alex Hughes Ahuge

🏡
Remote
View GitHub Profile
@Ahuge
Ahuge / game.py
Last active September 16, 2020 04:45
Game python help for Chris 2020.09.15
import json
from game_objects.enemy import EnemyCharacter
def create_new_enemy(enemy_dictionary):
print("Creating {name}".format(name=enemy_dictionary.get("name")))
xpos = enemy_dictionary.get("xpos")
ypos = enemy_dictionary.get("ypos")
return EnemyCharacter("enemy.png", xpos, ypos, 10, 10)
@Ahuge
Ahuge / environment_includes.py.patch
Last active January 9, 2020 18:39
Patch for tk-core tank.platform.environment_includes.py that allows merging of data from child includes.
--- /opt/shotgun_cache/ahughes/bundle_cache/app_store/tk-core/v0.18.170/python/tank/platform/environment_includes.py
+++ /opt/shotgun_cache/ahughes/bundle_cache/app_store/tk-core/v0.18.171/python/tank/platform/environment_includes.py
@@ -227,7 +227,11 @@
fw_lookup.update(included_fw_lookup)
lookup_dict.update(included_data)
-
+
+ try:
+ data = _merge_included_data(data, included_data)

Keybase proof

I hereby claim:

  • I am ahuge on github.
  • I am ahuge (https://keybase.io/ahuge) on keybase.
  • I have a public key ASDR9p_IxcuBF_w9Gsyanh_Gz1p7Eaq_ev0TU7rigeuWKAo

To claim this, I am signing this object:

@Ahuge
Ahuge / grip.css
Last active October 8, 2019 21:24
Grip CSS modifications
.markdown-body>article {
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
font-size: 16px;
line-height: 1.5;
word-wrap: break-word
display: block;
padding: 9px 10px 10px;
margin: 0;
background-color: #f6f8fa;
background-color: red;
@Ahuge
Ahuge / convert.sh
Last active March 11, 2019 23:23
FFMPEG script to convert two image sequences. To Use: `bash convert.sh` and answer it's questions
#!/bin/bash
function join_by { local IFS="$1"; shift; echo "$*"; }
read -r -p $'\e[;1;4mInput path with %d format:\e[0m ' INPUT_PATH;
read -r -p $'\e[;1;4mOutput directory:\e[0m ' OUTPUT_DIR;
read -r -p $'\e[;1;4mWould you like to convert the filetype? [y/N]\e[0m ' convertType
if [[ "$convertType" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
@Ahuge
Ahuge / terminaleditor.py
Created November 8, 2018 20:20
Terminal editor raw mode
import fcntl
import os
import tty
import termios
import struct
import sys
import traceback
DEBUGGING = True
@Ahuge
Ahuge / cst.py
Created May 17, 2018 02:48
black CST demo using modified lib2to3
"""
pgen2.tokenize
before counting indents/dedents insert this:
if line[pos] == '#': # Skip comments
comment_token = line[pos:].rstrip('\r\n')
nl_pos = pos + len(comment_token)
yield (COMMENT, comment_token,
@Ahuge
Ahuge / Bare_qtCore_slot_bug.py
Last active April 27, 2018 20:30
This is an example of where you need to pick either always using the decorator or never.
from PySide2 import QtCore
class MyObject(QtCore.QObject):
mySignal = QtCore.Signal()
mySignalA = QtCore.Signal()
mySignalB = QtCore.Signal()
def __init__(self):
@Ahuge
Ahuge / connect_slots_by_name_example.py
Last active April 27, 2018 20:25
Example of a case where you need a Slot decorator.
from PySide2 import QtWidgets, QtCore
class MyWidget(QtWidgets.QWidget):
def __init__(self, parent=None):
super(MyWidget, self).__init__(parent)
self.setLayout(QtWidgets.QVBoxLayout())
self.goBut = QtWidgets.QPushButton("Go!")
self.goBut.setObjectName("goBut")
@Ahuge
Ahuge / editor.py
Last active November 17, 2017 18:02
Text Editor
import fcntl
import os
import tty
import termios
import struct
import sys
import traceback
DEBUGGING = False