Skip to content

Instantly share code, notes, and snippets.

View gspetrou's full-sized avatar
🦑
Working hard at hardly working

George Petrou gspetrou

🦑
Working hard at hardly working
View GitHub Profile
@gspetrou
gspetrou / consolidate.ts
Created December 17, 2024 17:34
consolidateListsOfObjects Typescript
export const consolidateListsOfObjects = <Obj>(args: {
readonly objectLists: ReadonlyArray<ReadonlyArray<Obj>>;
readonly objectKeyFn: (obj: Obj) => string;
}): ReadonlyArray<ReadonlyArray<Obj>> => {
const parentMap = new Map<string, string>();
const find = (objKey: string): string => {
const parent = parentMap.get(objKey);
if (parent === undefined) {
return objKey;
}
@gspetrou
gspetrou / 431_p3_dataextract.py
Created March 29, 2019 01:09
Extracts relevant data from the bunch of benchmark simulations we had and saves the data into an excel spreadsheet
benchmarkFilesDir = "/Users/georgepetrou/Desktop/431_pe3/raw"
outputExcelFilePath = "/Users/georgepetrou/Desktop/431_pe3/output.xlsx"
## Dont edit below here
import os
import mmap
import xlsxwriter
def processData():
processedData = {}
@gspetrou
gspetrou / sh_animations_api.lua
Last active November 19, 2022 05:00
A simple api for animations in Garry's Mod
--[[
A simple animations API
Written by Stalker (http://steamcommunity.com/profiles/76561197996451757/)
For Kuma (http://steamcommunity.com/profiles/76561198061335920/)
Documentation:
All of the functions are serverside only.
Player:StartAnimation(number or string, boolean, function, number)