Skip to content

Instantly share code, notes, and snippets.

View tonytins's full-sized avatar
📚

Tony Bark tonytins

📚
View GitHub Profile
@tonytins
tonytins / lobby.gd
Last active January 3, 2019 18:54
Multiplayer lobby example from Godot documentation
# Typical lobby implementation, imagine this being in /root/lobby
extends Node
# Connect all functions
func _ready():
get_tree().connect("network_peer_connected", self, "_player_connected")
get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
get_tree().connect("connected_to_server", self, "_connected_ok")
@tonytins
tonytins / draw.gd
Created January 12, 2019 00:39
Drawing in Godot 3
# Via https://godotengine.org/qa/24621/painting-game-persist-drawing
# Based on http://zylannprods.fr/dl/godot/godot3/ChalkBoard.zip
extends Control
var _pen = null
var _prev_mouse_pos = Vector2()
func _ready():
var viewport = Viewport.new()
@tonytins
tonytins / compilation-license.txt
Created February 13, 2019 03:46
The compilation license used by Crypto++.
Compilation Copyright (c) [year] [person/company] All rights reserved.
This copyright applies only to this software distribution package
as a compilation, and does not imply a copyright on any particular
file in the package.
All individual files in this compilation are placed in the public domain by
Wei Dai and other contributors.
[Credits here]
@tonytins
tonytins / dotnet.yml
Last active September 17, 2020 22:15
Continuous integration for .NET. This assumes everything is in the /src directory.
name: .NET Core
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet: ["3.1.200", "3.1.201"]
@tonytins
tonytins / SourceBuilder.cs
Last active November 15, 2020 20:22
Source generator helper
using System;
using System.Text;
namespace SourceGen
{
internal class SourceBuilder
{
public SourceBuilder(string nameSpace, params string[] usings)
{
var builder = new StringBuilder($@"// This code was auto-generated{Environment.NewLine}");
@tonytins
tonytins / news_ticker.txt
Last active May 26, 2021 03:54
SC3k News Ticker Messages
50 Car Pile-Up Results In New City Sculpture
9 Out Of 10 Sims Prefer Cranberry Jelly Over Preserves
After 36 Years Of Marriage, Man Discovers Wife Is Actually A Rare Yucca Plant
All Raccoons Cheat At Poker, Animal Researchers Say
Ancient Meteorite Revealed To Be Burnt Burger
Ball Lightning Destroys Toupee But Polishes Victim's Car
Bark Art Exhibition By Bark Simson
Big Game Bistro Opens Amid Animal Rights Protests
Black And White Ball Disrupted By Bank Robbery
Black And White Ball Preparations Underway
@tonytins
tonytins / actions.yml
Last active September 7, 2022 15:16
Github Actions Branch Template
name: Example
on:
push:
branches: [develop, main, "feature/**", "patch/**"]
pull_request:
branches: [develop, main, "feature/**", "patch/**"]
jobs:
build_name:
@tonytins
tonytins / jsonhelper.gd
Created August 8, 2022 20:19
JSON Helper
extends Node
func key_value(json_path, json_file, key, is_dictionary = false):
var file = File.new()
var full_path = str(json_path + json_file);
if file.file_exists(full_path):
file.open(full_path, File.READ)
var result = parse_json(file.get_as_text())
if is_dictionary == true:
result.clear()
@tonytins
tonytins / workloads.sh
Last active October 12, 2022 21:49
.NET Workloads
#!/bin/bash
sudo dotnet workload install maui
sudo dotnet workload install maui-maccatalyst maui-ios maui-android
sudo dotnet workload install wasm-tools