Skip to content

Instantly share code, notes, and snippets.

View theraot's full-sized avatar

Alfonso J. Ramos theraot

  • Barranquilla - Atlántico - Colombia
View GitHub Profile
@theraot
theraot / gps_example.gd
Created March 20, 2025 11:59
Godot GPS example
extends VBoxContainer
const FONT_SIZE = 40
var android_runtime: Object
var location_manager: JavaObject
var output_label: Label
var normal_label_settings:LabelSettings
@theraot
theraot / binary_serializer.gd
Last active July 11, 2024 23:17
BinarySerializer for Godot 4.2+
@tool
class_name BinarySerializer
## Utility class to save and load data from StreamPeerBuffer.
## Number of bytes in 32 bits.
const BITS32 := 4
@theraot
theraot / mouse_lasso.gd
Last active April 19, 2021 18:23
Draw loops with the mouse
extends Node2D
class LoopCreator:
func is_type(type): return type == "LoopCreator" or .is_type(type)
func get_type(): return "LoopCreator"
signal loop(points_array)
var _points_array = PoolVector2Array()
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
public static void Main()
{
var encoded = LEB128.EncodeSignedLeb128FromInt32(624485);
var str = string.Concat(encoded.Select(entry => entry.ToString("X")));
@theraot
theraot / Parser.cs
Last active December 18, 2021 23:39
#r "nuget:Theraot.Core/3.0.3"
// This file is for RoslynPad
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Theraot.Core;
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
// This is based on an old test from Mono
Console.WriteLine("Hello World");
var trio = new SortedSet<int> { 0, 1, 2 };
<?php
/**
* CC-BY 3.0 Alfonso J. Ramos (theraot)
* UTF8
*/
final class UTF8
{
//------------------------------------------------------------
// Private (Class)
//------------------------------------------------------------
<?php
/**
* CC-BY 3.0 Alfonso J. Ramos (theraot)
* Parser
*/
final class Parser
{
//------------------------------------------------------------
// Private (Class)
//------------------------------------------------------------
// Note: Code For LinqPad
void Main()
{
bool TryGetCoordinates(string cell, out int indexRow, out int indexCol)
{
indexRow = -1;
indexCol = -1;
if (cell == null)
{
using System;
using System.IO;
using System.Net;
using Theraot.Core;
namespace AWDC
{
internal class Program
{
private static void Main()