Skip to content

Instantly share code, notes, and snippets.

View pcan's full-sized avatar
🕳️
down the white rabbit hole

Pierantonio Cangianiello pcan

🕳️
down the white rabbit hole
View GitHub Profile
@pcan
pcan / gai_strerror_shim.c
Created January 6, 2017 10:01
gai_strerror Shim for Luasocket static lib (compiled with MinGW)
/*
Specify the following options for the linker:
-Wl,--enable-stdcall-fixup
*/
#include "ws2tcpip.h"
char *
gai_strerrorA(
_In_ int ecode)
@pcan
pcan / typescript-types-test.ts
Last active January 5, 2017 15:46
A test of type serialization tool for TypeScript language.
class ClassTypeImpl implements reflect.ClassType {kind='class'}
class InterfaceTypeImpl implements reflect.InterfaceType {kind='interface'}
let node_modules = {
typescript : {
lib : {
lib.core.d : {
PropertyDescriptor : new InterfaceTypeImpl(),
PropertyDescriptorMap : new InterfaceTypeImpl(),
Object : new InterfaceTypeImpl(),
ObjectConstructor : new InterfaceTypeImpl(),
@pcan
pcan / SelfExpiringHashMap.java
Last active April 21, 2024 14:18
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
/*
* Copyright (c) 2019 Pierantonio Cangianiello
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is