Skip to content

Instantly share code, notes, and snippets.

View gromatluidgi's full-sized avatar

Luidgi Gromat gromatluidgi

View GitHub Profile
function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@davidgljay
davidgljay / ComponentIndex.js
Last active June 12, 2022 19:22
Pattern for dynamically loading React components based on a config json object.
import config from '../config'
let components = {}
//For each component in the config fiel into an object
for (var i = config.length - 1; i >= 0; i--) {
components[config[i].name] = require(config[i].path).default
}
export default components
@emg110
emg110 / winston_3_customization_by_chalk.js
Last active April 26, 2022 08:41
Winston 3 customization by chalk
const { createLogger, format, transports } = require('winston');
const chalk = require('chalk');
const { combine, timestamp, label, printf, simple, splat } = format;
const consoleFormat = printf(({ level, message, label, timestamp }) => {
var levelUpper = level.toUpperCase();
switch (levelUpper) {
case "INFO":
message = chalk.green(message);
level = chalk.black.bgGreenBright.bold(level);
break;
@gamerxl
gamerxl / ue4-json-parsing.cpp
Last active January 27, 2025 08:24
How to parse a json response (e.g. a json array) in ue4 c++ context.
/**
* Include the PrivateDependencyModuleNames entries below in your project build target configuration:
* PrivateDependencyModuleNames.AddRange(new string[] { "Json", "JsonUtilities" });
*/
#include "Runtime/Online/HTTP/Public/Http.h"
#include "Serialization/JsonSerializer.h"
FHttpResponsePtr Response;
@AmirHosseinKarimi
AmirHosseinKarimi / Icon.js
Last active January 16, 2023 23:57
Dynamic load Material Design Icons in React
import React from "react";
import { Icon as MDIcon } from "@mdi/react";
class Icon extends React.Component {
render() {
let icon = require(`materialdesign-js/icons/${this.props.icon}`).default;
if (!icon) {
throw Error(`Could not find materialdesign-js/icons/${icon}`);
}
return <MDIcon path={icon} />;
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2025 11:12
.NET 6 ASP.NET Core Migration