Skip to content

Instantly share code, notes, and snippets.

View divmgl's full-sized avatar

Dexter Miguel divmgl

  • San Francisco, CA
  • 09:02 (UTC -12:00)
View GitHub Profile
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
// Optional
TArray<FString> ContentPaths;
ContentPaths.Add(TEXT("/Game/My/Folder"));
AssetRegistry.ScanPathsSynchronous(ContentPaths);
// End Optional
TSet<FName> DerivedNames;
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active April 26, 2024 13:33
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@sindresorhus
sindresorhus / esm-package.md
Last active May 5, 2024 20:24
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@gamerxl
gamerxl / ue4-websocket-client.cpp
Last active January 6, 2024 04:17
How to create a websocket client / connection without setup third party libraries in ue4 c++ context.
/**
* Include the PrivateDependencyModuleNames entry below in your project build target configuration:
* // Depend on WebSockets library from UE4 (UE4 WebSockets implementation is built upon the libwebsockets library).
* PrivateDependencyModuleNames.AddRange(new string[] { "WebSockets" });
*/
#include "WebSocketsModule.h"
#include "IWebSocket.h"
{
@intinig
intinig / .clang-format
Last active January 13, 2024 11:56
.clang-format for UE4
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
@naesheim
naesheim / buildWhenAffected.sh
Last active November 28, 2022 20:20
CircleCi - only build features that has changed
##################
### config.yml ###
##################
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@hrbrmstr
hrbrmstr / badmail.Rmd
Last active December 1, 2016 07:59
Code for this post:
---
title: "Visualizing the Clinton Email Network in R"
author: "hrbrmstr"
date: "`r Sys.Date()`"
output: html_document
---
```{r include=FALSE}
knitr::opts_chunk$set(
collapse=TRUE,
comment="#>",
@leandrocp
leandrocp / elixir_with.ex
Last active April 10, 2016 05:48
Elixir With special form
case File.read("my_file.ex") do
{:ok, contents} ->
case Code.eval_string(contents) do
{res, _binding} ->
{:ok, res}
error ->
error
error -> error
error
end
@thinkdevcode
thinkdevcode / spirals.js
Created January 7, 2016 03:42
spirals, how do they work?
"use strict";
let directions = [[-1,0], [0,1], [1,0], [0,-1]];
function spiral(n) {
let matrix = [], total = n * n;
let x = 0, y = 0, val = 1;
/// initialize matrix
for (let i = 0; i < n; i++)