Skip to content

Instantly share code, notes, and snippets.

@fenix-hub
fenix-hub / #description.md
Last active July 12, 2024 21:49
GDScript JSON <> Class Serializer/Deserializer

You can find usages in the GDScript Unirest plugin

This is a fast serializer/deserializer written in GDScript to convert a JSON (Dictionary) to a class, using something similar to the Reflection concecpt. json_to_class can be used to convert a Dictionary to a Class. All keys in the Dictionary will be treated as variables and their types will be guessed in the best way possible. A class (defined by the class_name keyword) must extend Reference or Object or be an inner class, or else Godot will not able to see its properties. It is also possible to deserialize a JSON key to a class property with a different name using the export hint as a variable name.

example usage:

@dabit3
dabit3 / SingleTableAppSync.md
Last active February 24, 2023 20:05
GraphQL Single Table Design with DynamoDB and AWS AppSync

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}
@xErik
xErik / components>footer>footer.component.html
Last active February 16, 2022 19:56
Angular 8 | Bootstrap 4 | Footer at bottom of viewscreen OR after long page content
@andrhamm
andrhamm / await-state-machine-execution.js
Last active December 23, 2021 06:35
API Gateway Synchronous Step Function Execution
// handlers/await-state-machine-execution.js
import AWS from 'aws-sdk';
import { snakeCaseObj } from '../lib/common';
const stepfunctions = new AWS.StepFunctions({apiVersion: '2016-11-23'});
const {
STATE_MACHINE_ARN,
} = process.env;
@danthedaniel
danthedaniel / init.c
Last active February 9, 2023 13:21
DayZ SA Init Script - PvP Classes
void main()
{
Hive ce = CreateHive();
if (ce)
ce.InitOffline();
Weather weather = g_Game.GetWeather();
weather.GetOvercast().SetLimits(0.0, 1.0);
weather.GetRain().SetLimits(0.0, 1.0);
@onionmk2
onionmk2 / UsingJsonDotNetInUnity.cs
Last active August 17, 2022 20:08
Json.Net ( Newtonsoft.Json ) in Unity
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using UnityEngine;
public class UsingJsonDotNetInUnity : MonoBehaviour
{
private void Awake()
{
@jexp
jexp / trumpworld-detailed.adoc
Last active March 27, 2019 02:54
More detailed Neo4j Import of TrumpWorld from Buzzfeed https://www.buzzfeed.com/johntemplon/help-us-map-trumpworld

The TrumpWorld Graph

using System;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using log4net;
namespace Utils
{
@foo4u
foo4u / 30_docker_ports.config
Last active July 6, 2023 00:45
Infinispan on Amazon AWS Beanstalk (should work with vanilla EC2 and ECS)
files:
/opt/elasticbeanstalk/hooks/appdeploy/post/10_docker_nat.sh:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
set -u # Fail on unset variables
set -e # Fail if any command fails
PATH="$PATH:/sbin:/usr/bin"
@netcell
netcell / PhaserFillscreen.js
Last active February 22, 2024 23:02
Setting for Phaser.js to fill the screen on web browsers and Cocoon.js
/** Config part */
var FIXED_SIZE = 600;
var FIXED_MEASURE = 'Height';
/** Name maping */
var fixedName = FIXED_MEASURE;
var resName = fixedName === 'Height' ? 'Width' : 'Height';
var FIXED_NAME = fixedName.toUpperCase();
var RES_NAME = resName.toUpperCase();