Skip to content

Instantly share code, notes, and snippets.

View DaelonSuzuka's full-sized avatar
💭
LFG

David Kincaid DaelonSuzuka

💭
LFG
View GitHub Profile
@DaelonSuzuka
DaelonSuzuka / Files.gd
Created November 12, 2023 21:21
Godot File utility
@tool
extends Node
# ******************************************************************************
func check_extension(file, ext=null) -> bool:
if ext:
if ext is String:
if file.ends_with(ext):
return true
@DaelonSuzuka
DaelonSuzuka / rx.json
Created October 28, 2023 22:15
Godot LSP handshake
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"capabilities": {
"codeActionProvider": false,
"colorProvider": false,
"completionProvider": {
"resolveProvider": true,
"triggerCharacters": [".", "$", "'", "\""]
// update this section to reflect the pin numbers in the box
#define LED_GREEN_PIN 3
#define LED_RED_PIN 2
#define NUMBER_OF_PINS 4
int cableA[NUMBER_OF_PINS] = {6, 7, 8, 9};
int cableB[NUMBER_OF_PINS] = {15, 14, 16, 10};
@DaelonSuzuka
DaelonSuzuka / Makefile
Created November 11, 2022 19:15
Python Makefile
# **************************************************************************** #
# General Make configuration
# This suppresses make's command echoing. This suppression produces a cleaner output.
# If you need to see the full commands being issued by make, comment this out.
MAKEFLAGS += -s
# **************************************************************************** #
APP_FOLDER = app
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
tool
extends Node
# ******************************************************************************
func check_extension(file, ext=null) -> bool:
if ext:
if ext is String:
if file.ends_with(ext):
return true
tool
extends TextEdit
# ******************************************************************************
func _ready():
connect('request_completion', self, 'request_completion')
func request_completion():
print('request_completion')
@DaelonSuzuka
DaelonSuzuka / Example.gd
Last active February 16, 2022 15:22
MenuButton.gd
extends Control
# ******************************************************************************
onready var MenuButton = find_node('MenuButton')
# ******************************************************************************
func _ready():
# Add an optional callback when you create a menu item
@DaelonSuzuka
DaelonSuzuka / spi_bitbang.c
Last active November 4, 2021 02:47
SPI bitbang driver
#include "stdint.h"
/* ************************************************************************** */
#define set_STROBE_PIN(state) LATXbits.LATXY = state // your register here
#define set_CLOCK_PIN(state) LATXbits.LATXY = state // your register here
#define set_DATA_PIN(state) LATXbits.LATXY = state // your register here
static void spi_bitbang_tx_word(uint16_t word) {
@DaelonSuzuka
DaelonSuzuka / filesystem.gd
Created October 16, 2021 17:00
godotscript filesystem helpers
static func get_dir_files(path: String) -> PoolStringArray:
var arr: PoolStringArray
var dir := Directory.new()
dir.open(path)
if dir.file_exists(path):
arr.append(path)
else: