Skip to content

Instantly share code, notes, and snippets.

View jaredtbates's full-sized avatar

Jared Bates jaredtbates

View GitHub Profile

With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.

It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.

Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need

@brianfoody
brianfoody / DeadLetterQueueStack.ts
Last active March 16, 2024 21:47
Dead Letter Queue example with CDK
import { Queue } from "@aws-cdk/aws-sqs";
import { App, Duration, Stack, StackProps } from "@aws-cdk/core";
import { Runtime, Code, Function } from "@aws-cdk/aws-lambda";
import { SqsEventSource } from "@aws-cdk/aws-lambda-event-sources";
class DeadLetterQueue extends Stack {
constructor(parent: App, name: string, props?: StackProps) {
super(parent, name, props);
@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active June 3, 2024 22:43
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active May 8, 2023 16:40
Reading configuration files before application startup in Angular2 final release

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@ktheory
ktheory / Readme.md
Last active May 11, 2024 10:59
Easily make HTTPS requests that return promises w/ nodejs

Javascript request yak shave

I wanted to easily make HTTP requests (both GET & POST) with a simple interface that returns promises.

The popular request & request-promises package are good, but I wanted to figure out how to do it w/out using external dependencies.

The key features are:

  • the ability to set a timeout
  • non-200 responses are considered errors that reject the promise.
  • any errors at the TCP socker/DNS level reject the promise.
anonymous
anonymous / WynncraftSkinChangerScript.java
Created December 29, 2014 21:48
Wynncraft skin changing script for the people who want to know
package net.crunkle.membrane;
import net.minecraft.server.v1_7_R4.EntityPlayer;
import net.minecraft.server.v1_7_R4.EnumChatVisibility;
import net.minecraft.server.v1_7_R4.TileEntity;
import net.minecraft.util.com.mojang.authlib.GameProfile;
import net.minecraft.util.com.mojang.authlib.properties.Property;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player;
@DarkSeraphim
DarkSeraphim / SkinChanger.java
Last active May 5, 2020 18:37
Notchifier - Thou shall be Notch
package net.darkseraphim.test;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.comphenix.protocol.wrappers.PlayerInfoData;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.lang.reflect.*;
import java.util.*;
import org.bukkit.*;
import org.bukkit.entity.*;
/**
*
* Assorted methods for manipulating packets to spawn fake Ender Dragons and show players a
* status bar at the top of the screen using their health bar. This class uses reflection, so