Skip to content

Instantly share code, notes, and snippets.

View AJIADb9's full-sized avatar
♻️
Big Green Deals

Kirill AJIADb9

♻️
Big Green Deals
View GitHub Profile
@fenix-hub
fenix-hub / #description.md
Last active May 6, 2025 16:37
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:

@Anruin
Anruin / ue4_android_permission_wrapper.cpp
Last active June 18, 2021 21:12
UE4 Android Permission request wrapper macro
// Copyright 2021 Impossibility Labs Inc. https://github.com/ArtheonVR.
// Created by Egor Pristavka.
// Macro definition:
#if PLATFORM_ANDROID
#include "AndroidPermissionFunctionLibrary.h"
#include "AndroidPermissionCallbackProxy.h"
#define RUN_WITH_PERMISSION(perm, ...)\
LogF("AndroidPermission: Checking %s permission.", perm);\
if (!UAndroidPermissionFunctionLibrary::CheckPermission(perm)) {\
@Igneous01
Igneous01 / factorio_headless_aws_guide.md
Last active November 10, 2024 03:22 — forked from othyn/factorio_headless_guide.md
How to setup a Factorio Headless Server

[LINUX] Factorio Headless Server Guide for AWS EC2

So, with credit to the Factorio wiki and cbednarski's helpful gist, I have been able to successfully setup a Factorio headless server on AWS EC2 using the Amazon Linux 2 AMI (HVM), SSD Volume Type AMI.

This guide was done using the Amazon Linux 2 AMI image for EC2, and Factorio 1.19.0. However it is possible for this guide to also work on other linux AMI images.

Prerequisites

  • AWS Account
  • Licensed copy of factorio
  • That's it!
@jhansonhpe
jhansonhpe / register_schema.py
Last active September 29, 2020 14:55 — forked from aseigneurin/register_schema.py
Register an Avro schema against the Confluent Schema Registry
#!/usr/bin/python
# Licensed under the Apache 2.0 license
import os
import sys
import requests
schema_registry_url = sys.argv[1]
topic = sys.argv[2]
@amitripshtos
amitripshtos / elasticsearch-py-async-bulk.py
Created October 28, 2018 14:13
Asyncio bulk helper methods for elasticsearch-py-async (python 3.6+) , use it like a regular helper, with AsyncElasticsearch
from __future__ import unicode_literals
import logging
from operator import methodcaller
import asyncio
from elasticsearch.exceptions import TransportError
from elasticsearch.helpers import BulkIndexError, expand_action, _chunk_actions
from elasticsearch.compat import map
@norlin
norlin / UE5-Project.sublime-build
Last active September 4, 2025 08:14
Build system for Unreal Engine projects for Sublime Text
{
"cmd": [
// Default path for UE 5
"C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles/Build.bat",
// Build configuration is set to "Development" by default
"Development",
// The platform is set to Win64 by default
"Win64",
"-Project",
// The Sublime project name must match the Unreal project filename
@codingtim
codingtim / UdpServer.kt
Created April 5, 2017 10:44
Simple udp server with netty 4.1 and kotlin
import io.netty.bootstrap.Bootstrap
import io.netty.channel.ChannelHandlerContext
import io.netty.channel.SimpleChannelInboundHandler
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.nio.NioDatagramChannel
import io.netty.util.CharsetUtil
import io.netty.util.concurrent.DefaultThreadFactory
import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.experimental.newFixedThreadPoolContext
@othyn
othyn / factorio_headless_guide.md
Last active February 3, 2026 22:23
How to setup a Factorio Headless Server

[LINUX] Factorio Headless Server Guide

So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.

The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS. Although, that shouldn't matter, as long as your distro supports systemd (just for this guide, not a Factorio headless requirement, although most distros use it as standard now). The version of Factorio I shall be using is 0.14.20, although should work for any version of Factorio 0.14.12 and higher.

Just a note to newcomers: If there are any issues with the installation steps, people in the comments are doing a good job

@babakness
babakness / caselessDictionary.py
Created October 16, 2012 18:46 — forked from bloomonkey/caselessDictionary.py
A Python dictionary sub-class that is case-insensitive when searching, but also preserves the keys as inserted.
class CaselessDictionary(dict):
"""Dictionary that enables case insensitive searching while preserving case sensitivity
when keys are listed, ie, via keys() or items() methods.
Works by storing a lowercase version of the key as the new key and stores the original key-value
pair as the key's value (values become dictionaries)."""
def __init__(self, initval={}):
if isinstance(initval, dict):
for key, value in initval.iteritems():
@eberle1080
eberle1080 / module_watcher.py
Created June 7, 2011 20:50
Automatically reload python module / package on file change
#!/usr/bin/env python
# Author: Chris Eberle <eberle1080@gmail.com>
# Watch for any changes in a module or package, and reload it automatically
import pyinotify
import imp
import os
class ModuleWatcher(pyinotify.ProcessEvent):
"""