Skip to content

Instantly share code, notes, and snippets.

View muit's full-sized avatar

Miguel Fernandez Arce muit

View GitHub Profile
@muit
muit / PtrOwner.h
Last active July 28, 2020 11:18
Smart pointer based on ownership. 1 owner, many weaks
// Copyright 2015-2020 Piperift - All rights reserved
#pragma once
#include "Platform/Platform.h"
#include <atomic>
namespace VCLang
@muit
muit / MyManager.cpp
Last active November 14, 2022 19:47
4.22 Subsystems vs Managers
#include "MyManager.h"
#include <Engine/Engine.h>
#include <GameDelegates.h>
TMap<TWeakObjectPtr<UGameInstance>, TWeakObjectPtr<UMyManager>> UMyManager::GlobalManagers {};
void UMyManager::DoInitialize()
{
@muit
muit / ScopedTaskList.h
Created January 13, 2019 22:55
Keeps an array of multi-threaded tasks in order without memory leaks and with a nice syntax (in UE4)
// Copyright 2015-2019 Piperift. All Rights Reserved.
#pragma once
#include <Async/AsyncWork.h>
#include "Misc/TypeTraits.h"
class ITaskHolder {
public:
@muit
muit / ScopedTaskManager.h
Last active January 13, 2019 22:53
A multithreading task manager in compile time. Ensures no memory leaks and correct completion of tasks.
// Copyright 2015-2018 Piperift. All Rights Reserved.
#pragma once
#include <Async/AsyncWork.h>
#include "Misc/TypeTraits.h"
template<class TaskType>
class FTaskHolder : public FAsyncTask<TaskType> {
#include "MyEditorPrivatePCH.h"
#include "Kismet2/KismetEditorUtilities.h"
DEFINE_LOG_CATEGORY(LogMyEditor)
#define LOCTEXT_NAMESPACE "MyEditor"
void FMyEditorModule::StartupModule()
{
@muit
muit / EditorModule.h
Last active June 17, 2019 15:13
Registering Default Blueprint Nodes
#pragma once
#include "MyEditorPrivatePCH.h"
DECLARE_LOG_CATEGORY_EXTERN(LogMyEditor, All, All)
class FMyEditorModule: public IModuleInterface
{
public:
virtual void StartupModule() override;
@muit
muit / syntax.js
Last active November 3, 2015 11:28
New possible serveme syntax
//ServeMe - github.com/muit/serveMe
var server = ServeMe();
server.get("/user").do(authenticated).do(function(req, res) {
return {
json: {
message: "Hey!"
}
};
});
/**
* Wait for x events to finish, and then call a function.
* @param {Array} ids [Registered event ids]
*/
function EventWaiter(ids){
if(names instanceof Array) {
this.waitEvents = ids;
}
}
@muit
muit / gist:13cf2b2ab3a582d52acb
Last active August 29, 2015 14:25
WildBoard Dokify manifest
{
"update_rate": "00 00 00 * * *",
"provider": {
"name": "dokify",
"url": "https://dokify.net"
},
"sources": [
{
"name": "total-checkins-24hours",
"description": "The amount of checkins made in the last 24hours",
@muit
muit / Trigger.cs
Last active August 29, 2015 14:18
Trigger util class on c#
/** If using Unity, remove this commentary
* [System.Serializable]
**/
public class Trigger{
public bool value;
public Trigger(bool value = true) {
this.value = value;
}