Skip to content

Instantly share code, notes, and snippets.

View Dvergar's full-sized avatar
🌶️

Caribou (lraymond) Dvergar

🌶️
View GitHub Profile
@Dvergar
Dvergar / locale_test.dart
Created June 19, 2024 14:20
Testing date separators
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
void main() async {
await initializeDateFormatting();
const locale = 'iw';
final DateTime now = DateTime.now();
final DateFormat formatter = DateFormat('yMd', locale);
@Dvergar
Dvergar / main.dart
Last active March 13, 2024 09:26
Event kind
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@Dvergar
Dvergar / keybindings.json
Created February 22, 2019 13:02
Less < and greater > bindings for VSCode as AZERTY layout on QWERTY keyboard on Chrome OS is super annoying
[
{ "key": "[Backquote]", "command": "type",
"args": { "text": "<" },
"when": "editorTextFocus" },
{ "key": "ctrl+[Backquote]", "command": "type",
"args": { "text": ">" },
"when": "editorTextFocus" }
]
@Dvergar
Dvergar / EntityManager.hx
Created December 10, 2018 12:23
YAML support
package osis;
import haxe.ds.IntMap;
import haxe.ds.Vector;
import haxe.macro.Expr;
import haxe.macro.Context;
import haxe.Int64;
import anette.*;
import anette.Protocol;
@Dvergar
Dvergar / Pathfinder.hx
Created November 14, 2018 12:15
Pathfinder module modified for going around corners with 8-way movemens
/* __ __ _____ __
* ____ ____ _/ /_/ /_ / __(_)___ ____/ /__ _____
* / __ \/ __ `/ __/ __ \/ /_/ / __ \/ __ / _ \/ ___/
* / /_/ / /_/ / /_/ / / / __/ / / / / /_/ / __/ /
* / .___/\__,_/\__/_/ /_/_/ /_/_/ /_/\__,_/\___/_/
* /_/
*
* Copyright (c) 2013, Robert Fell
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@Dvergar
Dvergar / Main.hx
Last active December 12, 2016 22:46
Variable listener
import lemino.Listener;
using lemino.Lemino;
class HpView
{
public function new() {}
public function onHpUpdate(value:Int, player:Player)
trace("hpupdate " + value);
@Dvergar
Dvergar / luxe_reminder.md
Created December 5, 2016 12:10
Luxe reminder
@Dvergar
Dvergar / BuildComponents.hx
Last active August 29, 2015 14:07
Build Types (components) from a YAML file
import haxe.macro.Expr;
import haxe.macro.Context;
import yaml.Yaml;
import yaml.Parser;
import yaml.util.ObjectMap;
class BuildComponents {
macro static public function build():Array<Field> {
@Dvergar
Dvergar / VersionMacro.hx
Created September 14, 2013 15:16
Macro to get project version from an OpenFL project file
#if macro
import sys.io.File;
#end
import haxe.macro.Expr;
import haxe.macro.Context;
class VersionMacro
{
macro public static function getGameVersion(projectFileName:String):Expr
{