Skip to content

Instantly share code, notes, and snippets.

View SMJSGaming's full-sized avatar
Working 24/7

SMJS SMJSGaming

Working 24/7
  • SMJS Productions
  • the Netherlands, Almere
  • 21:18 (UTC +02:00)
View GitHub Profile
@SMJSGaming
SMJSGaming / BetterObject.ts
Last active November 4, 2021 19:29
A class which throws all the questionable types from the Object class out of the window and instead uses more accurate types
export class BetterObject<T> {
public static assign<T, U>(target: T, ...sources: U[]): T & U {
// Tricking the compiler because merging 2 types by reference isn't truly possible
sources.forEach((source) => Object.entries(source).forEach(([key, value]) => target[key as keyof T] = value));
return target as T & U;
}
public static merge<T>(target: T, ...sources: T[]): T {
@SMJSGaming
SMJSGaming / CCAnimateFrameCache.hpp
Created May 1, 2022 14:24
A full reload system for Geometry Dash using cocos2d
#pragma once
#include <cocos2d.h>
using namespace cocos2d;
namespace cocos2d {
struct CCAnimateFrameCache : CCObject {
CCDictionary* m_dict0;
CCDictionary* m_dict1;