Skip to content

Instantly share code, notes, and snippets.

View bohdon's full-sized avatar

Bohdon Sayre bohdon

View GitHub Profile
@rtm223
rtm223 / RTMHUDBase.cpp
Created June 12, 2024 18:42
Base Class Unreal HUD that can hide all widgets via the ShowHUD console command and when you enter simulate
#include "UI/HUD/RTMHUDBase.h"
#include "Engine/LocalPlayer.h"
#include "GameFramework/PlayerController.h"
#include "Widgets/SViewport.h"
namespace RTMHUDBaseStatics
{
SWidget* FindWidgetByTypeRecursive(SWidget* root, FName widgetType)
{
SWidget* ret = nullptr;
@intaxwashere
intaxwashere / customthunkexample.md
Last active August 31, 2024 10:12
Custom Thunks Unreal Engine TL;DR

Custom thunks TL;DR

This smol post assumes you worked on a custom thunk implementation before but no idea how it works, why you're using cursed macros from 1990s etc. If you don't have any programming experience or relatively new to Unreal world, it's likely you might not understand anything from this post, not because concepts are too difficult to grasp, but rather because this post is written for the people who has an understanding of how Unreal works since a while and want to expand their knowledge of custom thunks implementation.

Part 1:

  • A thunk is a function that you can save and call later, so if you had an array of TFunction<void()>s, you would have an array of custom thunks that you can bind/unbind new function pointers to existing TFunctions.
  • Custom thunks of Blueprints are the same, they're a fancy array/list of function pointers. Imagine for each node you placed to graph, Blueprints have a place for that node in it's list of custom thunks. For example the + node in Blueprints that
@harry-jung
harry-jung / TickInGameInstance.cpp
Created June 11, 2018 05:06
Tick in GameInstance
//.h file
void Init() override;
void Shutdown() override;
bool Tick(float DeltaSeconds);
FDelegateHandle TickDelegateHandle;
@mottosso
mottosso / Dock.py
Last active October 13, 2023 09:01 — forked from liorbenhorin/Simple_MayaDockingClass.py
Simple way to dock Qt widgets to Maya 2017+
from maya import cmds, OpenMayaUI as omui
from Qt import QtWidgets, QtCore, QtCompat
def Dock(Widget, width=300, show=True):
"""Dock `Widget` into Maya
Arguments:
Widget (QWidget): Class
show (bool, optional): Whether to show the resulting dock once created
@ryusas
ryusas / workspaceControl.py
Created April 18, 2017 06:57
A simple example to avoid the issue of Maya 2017 workspaceControl.
# coding: utf-8
u"""
Maya 2017 workspaceControl の問題回避のサンプル。
workspaceControl と workspaceControlState のゴミが残らないようにする。
retain=False の場合でも何故か state のゴミが残ってしまうが、
scriptJob で workspaceControl の削除を監視して state も同時に削除するようにする。
retain=True の場合は、UI が閉じたとしても state は残って良いはずなので監視はしない。
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@subfuzion
subfuzion / curl.md
Last active November 19, 2024 20:02
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@kaito834
kaito834 / urllib-request_basicAuth.py
Last active October 26, 2022 17:52
Python 3.x snippet code for Basic Authentication HTTP request by urllib.request
#!/usr/bin/env python
#
# I tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
import urllib.request
import getpass
# If you access to url below via Proxy,
# set environment variable 'http_proxy' before execute this.
@nitaku
nitaku / README.md
Last active November 18, 2022 05:37
Tablet test (desktop)

And now for something completely different: a Windows desktop application! Open this gist for the code.

This example uses a python wrapper around Wacom's Wintab/Feel driver to read a Wacom stylus input, and draws a representation of it onto a Tkinter canvas. Each circle represents a point, and its radius is proportional to the pressure of the stylus.

To run the application, you will need: a (Wacom?) tablet or a tablet PC, Microsoft Windows (I tried it with 8.1), Python 3.3, cgkit 2, the code from this repo. To actually run it, open a command prompt where you put the python files, then execute:

python test.py