Skip to content

Instantly share code, notes, and snippets.

View audinue's full-sized avatar

Audi Nugraha audinue

  • Surabaya, Jawa Timur, Indonesia
View GitHub Profile
@audinue
audinue / README.md
Last active January 26, 2018 22:08
Fun

Fun

Fun is a javascript entity-component-system game framework.

Entities is represented by a plain javascript object.

// The player entity
const player = {
}
@audinue
audinue / Publisher.cs
Last active July 28, 2017 02:47
Powerful message subscription system.
/// <summary>
/// Represents an abstract generic message.
/// </summary>
public abstract class Message<T> {
private readonly T content;
public Message(T content) {
this.content = content;
}
@audinue
audinue / Container.cs
Created August 9, 2017 07:19
An automatic dependency injection container.
using System;
using System.Collections.Generic;
using System.Linq;
public sealed class Container
{
private Dictionary<Type, Type> concreteTypes = new Dictionary<Type, Type>();
private Dictionary<Type, object> objects = new Dictionary<Type, object>();
@audinue
audinue / batch.cmd
Created August 10, 2017 03:17
Konversi video buat LG TV 42PT350R
rem konversi satu directory
for %%i in (*.mp4) do call conv "%%i"
public interface ISubscriber<T>
{
void Receive(T message);
}
internal class SubscriberList : IEnumerable<object>
{
private Dictionary<Type, List<object>> subscription = new Dictionary<Type, List<object>>();
class Orderable : IOrderable
{
private int order;
private string name;
public Orderable(int order, string name)
{
this.order = order;
this.name = name;
/*
Composable 3x3 matrix module.
Exported functions:
- createIdentity (): Matrix
- createTranslation (tx: Number, ty: Number): Matrix
- createScaling (sx: Number, sy: Number): Matrix
- createRotation (a: Number): Matrix
- toRadians (d: Number): Number
- createRotationDegrees (a: Number): Matrix
@audinue
audinue / Pools.cs
Created August 19, 2017 08:00
Eager and lazy object pools.
using System;
/// <summary>
/// Implements a pool of T.
/// </summary>
public interface IPool<T>
where T : class, new()
{
T Use();
using OpenTK;
using SkiaSharp;
using System;
class SKGameWindow : GameWindow
{
private GRContext context;
protected override void OnLoad(EventArgs e)
{
@audinue
audinue / static.cmd
Last active August 27, 2017 10:12
One liner static file web server for everyday use.
node -e "const e=require('express');e().use(e.static('.')).listen(80)"