Skip to content

Instantly share code, notes, and snippets.

View williamd1k0's full-sized avatar
🌈
Working with Godot Engine and Flutter

Tumeo williamd1k0

🌈
Working with Godot Engine and Flutter
View GitHub Profile
@williamd1k0
williamd1k0 / EditorIconTexture.gd
Created May 6, 2024 23:46
Helper Texture class to use Godot Editor icons in plugins, such as main screen plugins.
@tool
class_name EditorIconTexture
extends AtlasTexture
var icon :String:
set(val):
icon = val
_update_icon.call_deferred()
func _init():
@williamd1k0
williamd1k0 / client.py
Created January 26, 2024 20:28 — forked from nuno-andre/client.py
Sanic + MessagePack
import requests
from json import dumps, loads
from msgpack import packb, unpackb
data = {'say': 'hello, world!'}
headers_msgpack = {'Content-Type': 'application/msgpack'}
headers_json = {'Content-Type': 'application/json'}
r = requests.post('http://localhost:8000/', data=packb(data), headers=headers_msgpack)
print(unpackb(r.content))
@williamd1k0
williamd1k0 / tradingview_financials.py
Created February 14, 2023 05:16
Format TradingView Financials data for compatibility with LibreOffice Calc.
#!/usr/bin/python
# This script is designed to be used with TextPieces
# Argument 1: Base (K/M/B/T)
# Argument 2: Base Format ({n} = number; {b} = base)
import sys, re
from decimal import Decimal
diff_pattern = re.compile(r'[\+\-−][0-9\.]+%')
date_pattern = re.compile(r'[0-9]{4}|(TTM)|(Current)')
select row_number() over () sid, start, end as stop, 0 as rating, note as comment
from diary
where act_id == 9 and _deleted == 0;
@williamd1k0
williamd1k0 / sshd_gitbash.sh
Created August 14, 2022 00:17 — forked from fengli320/sshd_gitbash.sh
How to setup SSHD in Git Bash
# Precondition: Git for Windows 2.9.0 + Windows 7, other version of Git for Windows & Windows XP and Windows 10 should also be supported
# In /etc/ssh/sshd_config, set UsePrivilegeSeparation to no
# You can also change other settings of SSHD like port in this file
# Generate key pairs
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -q -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -q -N ""
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -q -N ""
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -q -N ""
@williamd1k0
williamd1k0 / deps.txt
Last active August 1, 2022 18:50
Simple shell script to download a file using zenity as GUI (useful for file manager integration).
zenity
xclip
aria2
@williamd1k0
williamd1k0 / Comment.cs
Created July 29, 2022 05:05 — forked from edwardrowe/Comment.cs
Unity - Draw Icon on GameObject in Hierarchy
/*The MIT License (MIT)
Copyright (c) 2016 Edward Rowe (@edwardlrowe)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@williamd1k0
williamd1k0 / Makefile
Last active April 26, 2023 23:50
Simple dependency and ownership finder for Unity assets.
INSTALL_DIR = ${HOME}/.local/bin
INSTALL_TARGETS = $(patsubst %,${INSTALL_DIR}/unity-%,guid projdir cache deps owns globals)
install: ${INSTALL_TARGETS}
${INSTALL_DIR}/%: ./%
install -Dm 764 $< $@
uninstall:
rm ${INSTALL_TARGETS}
Your name? define(`_name_', esyscmd(`head -n1 /dev/stdin | tr -d "\n"'))dnl
Hello, _name_!