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
@passivestar
passivestar / Editor.tres
Last active January 12, 2026 08:28
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@kasthor
kasthor / Main.gd
Last active January 3, 2024 18:23
Minimum code to draw an image to screen in Godot
extends Node2D
var image
var should_update_canvas = false
var drawing = false
# Called when the node enters the scene tree for the first time.
func _ready():
create_image()
update_texture()
@BigRoy
BigRoy / maya_rendersetup_get_attr_value_in_layer.py
Last active February 27, 2024 03:51
Query the attribute value in Maya Render Setup layer without switching layer
from maya import cmds
import maya.api.OpenMaya as om
import pymel.core as pm
import maya.app.renderSetup.model.utils as utils
from maya.app.renderSetup.model import (
override,
selector,
collection,
renderLayer,
#!/bin/sh
IP_PUBLIC=$(dig ipinfo.io/ip +short)
echo "\n=====:: MY IP PUBLIC ::=====\n"
curl -s ipinfo.io | python -c "exec(\"import sys\nimport json\nfor k, v in json$
echo "\n============================\n"

Render Setup Module:

import maya.app.renderSetup.model.override as override
import maya.app.renderSetup.model.selector as selector
import maya.app.renderSetup.model.collection as collection
import maya.app.renderSetup.model.renderLayer as renderLayer
import maya.app.renderSetup.model.renderSetup as renderSetup

Export & Import Render Setup:

@lig
lig / commit.py
Created March 30, 2020 09:15
pygit2 create commit simple
import pygit2
repo = pygit2.Repository(path='.')
repo.index.add_all()
repo.index.write()
tree = repo.index.write_tree()
parent, ref = repo.resolve_refish(refish=repo.head.name)
repo.create_commit(
@tanaikech
tanaikech / submit.md
Last active March 29, 2024 09:47
Simple Script of Resumable Upload with Google Drive API for Python

Simple Script of Resumable Upload with Google Drive API for Python

This is a simple sample script for achieving the resumable upload to Google Drive using Python. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.

In this sample, a PNG file is uploaded with the resumable upload using a single chunk.

Sample script

Before you use this, please set the variables.

@jnalley
jnalley / singleton.py
Created February 1, 2020 01:10
A singleton "like" Python snippet using lru_cache
#!/usr/bin/env python3
from functools import lru_cache
class Singleton:
@lru_cache
def __new__(cls, *args, **kwargs):
return super().__new__(cls)
@NovemberDev
NovemberDev / godot_async_scene_loader.gd
Last active March 12, 2025 16:00
Asynchronously loads scenes in godot
# Loads a scene in the background using a seperate thread and a queue.
# Foreach new scene there will be an instance of ResourceInteractiveLoader
# that will raise an on_scene_loaded event once the scene has been loaded.
# Hooking the on_progress event will give you the current progress of any
# scene that is being processed in realtime. The loader also uses caching
# to avoid duplicate loading of scenes and it will prevent loading the
# same scene multiple times concurrently.
#
# Sample usage:
#
@cart
cart / FXAA.tscn
Last active October 14, 2025 03:21
Godot Nvidia FXAA 3.11 Port
[gd_scene load_steps=3 format=2]
[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
// Godot Nvidia FXAA 3.11 Port
// Usage: Drop this in to any 3D scene for FXAA! This is a port of the \"PC High Quality Preset 39\". However the medium quality
// parameters are also included. For medium quality, just comment out sections \"PS 6\" and above and uncomment the \"med 13\" variables.