Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Gerst20051 / skills.txt
Created December 30, 2024 21:51
Welcome to the Jungle (Otta) List Of Skills
Abstract
Active Directory
Adjust
Adobe Campaign
Adobe Creative Cloud
Adobe Creative Suite
Adobe Experience Manager
Adobe Omniture
Adobe Premiere
After Effects
require 'socket'
require 'rack'
require 'rack/lobster'
app = Rack::Lobster.new
server = TCPServer.new 5678
while session = server.accept
request = session.gets
puts request
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
var Base64 = {
// private property
@Gerst20051
Gerst20051 / DebounceHookApp.tsx
Last active December 18, 2024 20:22
React Debounce Hook App
import React, { useState } from 'react'
import './DebounceApp.css'
function debounce(fn, delay) {
let handlerId
return (...args) => {
clearTimeout(handler)
handlerId = window.setTimeout(() => {
@Gerst20051
Gerst20051 / shuffle_array_fairness.py
Created April 30, 2024 17:35
Shuffle Array Fairness
import random
unshuffled_array = [1, 2, 3, 4, 5]
def shuffle_array_v1(arr):
output = []
count_of_items_in_arr = len(arr)
while count_of_items_in_arr:
random_index = random.randint(0, count_of_items_in_arr - 1)
item = arr[random_index]
@Gerst20051
Gerst20051 / secret_meetings.rb
Created April 25, 2024 21:44
Secret Meetings
# /*
# There are N people
# Some subset of the N people know the secret
# There are M meetings which are encoded as subsets of the N people
# There is a total order over the meetings that tells you the order in which they occur
# When people meet they share the secret
# Calculate the set of people who know the secret after all the meetings
# */
@Gerst20051
Gerst20051 / resume.json
Created March 5, 2023 08:18
JSON Resume
{
"basics": {
"name": "Andrew Gerst",
"label": "Senior Software Engineer"
}
}
@Gerst20051
Gerst20051 / flatten.js
Last active November 3, 2023 01:19
Flatten JS Object Keys
function flatten(obj) {
const result = {};
for (const key of Object.keys(obj)) {
if (typeof obj[key] === 'object') {
const nested = flatten(obj[key]);
for (const nestedKey of Object.keys(nested)) {
result[`${key}.${nestedKey}`] = nested[nestedKey];
}
} else {
result[key] = obj[key];
@Gerst20051
Gerst20051 / watch.command.sh
Last active November 17, 2022 05:32
Bash Watch Command
# execute commands at a specified interval of seconds
function watch.command {
# USAGE: watch.commands [seconds] [commands...]
# EXAMPLE: watch.command 5 date
# EXAMPLE: watch.command 5 date echo 'ls -l' echo 'ps | grep "kubectl\\\|node\\\|npm\\\|puma"'
# EXAMPLE: watch.command 5 'date; echo; ls -l; echo; ps | grep "kubectl\\\|node\\\|npm\\\|puma"' echo date 'echo; ls -1'
local cmds=()
for arg in "${@:2}"; do
echo $arg | sed 's/; /;/g' | tr \; \\n | while read cmd; do
cmds+=($cmd)
@Gerst20051
Gerst20051 / gitlab-graphql-console-script.js
Last active August 19, 2022 23:05
GitLab GraphQL Console Script
(async () => {
const gitlabHost = window.location.host;
const gitlabUser = 'andrew';
const workingDirPath = '~/Desktop';
const snippetDirName = 'gitlab-snippets';
const getSnippetInfoForIds = async ids => {
const rawResponse = await fetch(`https://${gitlabHost}/api/graphql`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',