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
@ksvbka
ksvbka / worker-threadpool.py
Created December 19, 2018 15:29
Demo worker threadpool and report progress in PyQT.
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QPushButton, QWidget
from PyQt5.QtCore import QObject, QRunnable, QThreadPool,pyqtSlot, pyqtSignal
import time
import traceback, sys
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 16, 2026 00:56
Conventional Commits Cheatsheet
@fire
fire / godot_style_guide.md
Last active November 9, 2019 16:39
godot_style_guide
@jhonnymichel
jhonnymichel / gamedev-trigonometry.md
Last active December 9, 2025 21:01
Basic trigonometry for game development

Introduction

two distinct points (for example, a game object position and the mouse cursor position) in an area can always be two corners of a Right Triangle (Triângulo-retângulo in ptbr). A triangle has three sides: The Hypotenuse, the Adjacent and the Opposite.

The distance between two points in the X axis corresponds to the Adjacent side of a triangle, The distance between two points in the Y axis corresponds to the Opposite side of a triangle.

The Hypotenuse is the shortest distance between the two points.

This means we can use trigonometry to handle many interactions between objects when programming visual stuff.

@davidas13
davidas13 / maya_floating_win.py
Created June 25, 2018 07:44 — forked from fredrikaverpil/maya_floating_win.py
Window floating atop Maya 2017
from PySide2 import QtWidgets, QtCore
def _maya_main_window():
"""Return Maya's main window"""
for obj in QtWidgets.qApp.topLevelWidgets():
if obj.objectName() == 'MayaWindow':
return obj
raise RuntimeError('Could not find MayaWindow instance')
@CITGuru
CITGuru / emailcli.py
Last active September 26, 2022 21:53
EmailCLI - A Python Command Line App for sending mails using SendGrid
import os
import re
import click
import sendgrid
import six
from pyconfigstore import ConfigStore
from PyInquirer import (Token, ValidationError, Validator, print_json, prompt,
style_from_dict)
from sendgrid.helpers.mail import *
@juampynr
juampynr / CHANGELOG.md
Created March 27, 2018 09:35
Sample CHANGELOG

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased] - yyyy-mm-dd

Here we write upgrading notes for brands. It's a team effort to make them as

@nosh247
nosh247 / GDScriptCamera.gd
Created March 6, 2018 18:55
Zelda like camera movement - Godot 3.0
extends Camera2D
onready var window_size = Vector2(320,240)#OS.get_window_size()
onready var player = get_parent().get_node("Player")
onready var player_world_pos = get_player_world_pos()
onready var new_player_grid_pos = Vector2()
onready var tweenStart = false
onready var tween = get_node("Tween")
onready var new_cam_pos = Vector2()
@iRadEntertainment
iRadEntertainment / trail.gd
Created January 30, 2018 23:00
Godot Engine (GDscript) - 2D adjustable trail by Yellatch Games
#Draw trails with lines
#A NON-PERFECT SCRIPT FOR Godot v2.1.* *NOTE THIS SCRIPT STILL HAVE SOME REF ISSUES, CHECK FOR ERRORS IN THE DEBUGGER
#This script has to be attached to scene with only a Control Node
#This scene can be instanced as child of a moving node
#after that the code can be initialized calling scia_setup() func:
#arguments ( nuovo_oggetto = "the parent node reference goes here"
num_step = "number of steps (50 by default)
nuovo_colore = Color() (Opaque white by default)
nuova_trasp = Initial alpha transparency (adjust the formula for other fading effects)
@AndersonFirmino
AndersonFirmino / Godot IAP.gd
Created January 5, 2018 22:34 — forked from FEDE0D/Godot IAP.gd
In app purchases in Godot Engine: Examples
# Intent: interface to the GodotPayments module (remember to add the java path in the project settings android>modules )
"Intent.gd"
extends Node
# Interface for the GodotPayments module
# To use extend this script and save the result on the Global singleton 'Data'
const STATIC_RESPONSE_NONE = 0
const STATIC_RESPONSE_ALL = 1