Skip to content

Instantly share code, notes, and snippets.

View theoparis's full-sized avatar

Theo Paris theoparis

View GitHub Profile
@theoparis
theoparis / .gitlab-ci.yml
Last active October 2, 2020 04:33
gitlab ci - deploy to remote docker server and run image
image: docker:stable
stages:
- deploy
docker push latest:
stage: deploy
only:
- pushes
script:
@theoparis
theoparis / map.py
Created October 8, 2020 03:11
python map c;lass (utility)
class Map(dict):
"""
Example:
m = Map({'first_name': 'Eduardo'}, last_name='Pool', age=24, sports=['Soccer'])
"""
def __init__(self, *args, **kwargs):
super(Map, self).__init__(*args, **kwargs)
self.parse(args)
@theoparis
theoparis / .babelrc
Created October 28, 2020 23:53
babelrc for parcel with preact apps w/typescript
{
"presets": ["@babel/env", ["@babel/typescript", { "jsxPragma": "h" }]],
"plugins": [
["@babel/transform-react-jsx", { "pragma": "h" }],
"@babel/proposal-optional-chaining",
"@babel/proposal-nullish-coalescing-operator"
]
}
@theoparis
theoparis / README.md
Last active November 5, 2020 19:32
install sharenix on macos catalina w/ homebrew

install sharenix on macos catalina w/ homebrew

brew install golang gdk-pixbuf pango gtk
go install github.com/Francesco149/sharenix
import { Inject, Injectable, Optional } from "@nestjs/common";
import get from "lodash.get";
import {
CONFIGURATION_TOKEN,
VALIDATED_ENV_PROPNAME,
} from "./config.constants";
import { NoInferType } from "./types";
import Joi from "joi";
import { PrefixLogger } from "@toes/core";
import {
@theoparis
theoparis / Dockerfile
Last active November 18, 2020 22:26
python3 docker w/ poetry
FROM python:3.9-alpine
RUN mkdir /app
WORKDIR /app
RUN pip install poetry poethepoet
RUN poetry config settings.virtualenvs.create false
COPY poetry.lock pyproject.toml README.md /app/
# to prevent poetry from installing my actual app,
# and keep docker able to cache layers
@theoparis
theoparis / types.ts
Last active December 29, 2020 04:58
typed api test
import { HTTPMethod } from "http-method-enum";
export type TypedApiMethods = {
[method in HTTPMethod]?: TypedRoute;
} & {
children?: TypedApiMethods[];
path: string;
};
export interface TypedRoute<
@theoparis
theoparis / nodejs_egg.json
Last active January 25, 2021 19:54
pterodactyl node.js egg (node 14)
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1"
},
"exported_at": "2020-08-13T22:04:35-04:00",
"name": "node.js generic",
"author": "[email protected]",
"description": "a generic node js bot egg\r\n\r\nThis will clone a git repo for a bot. it defaults to master if no branch is specified.\r\n\r\nInstalls the node_modules on install with yarn. If you set user_upload then I assume you know what you are doing.",
"image": "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-14",
@theoparis
theoparis / README.md
Last active January 27, 2021 02:14
centos install pterodactyl w/ docker

Instructions:

Run this to install the panel:

curl https://gist.github.com/creepinson/9680665877fa868eccf70541dc477aca/raw/1bbf9da05d34210676848168f5824d68505f9290/install.sh | sh
@theoparis
theoparis / README.md
Created February 3, 2021 22:49
backup file structure glob to json file

File Structure -> JSON Array

Usage

python3 main.py "root_dir" "sub_dir/*"

Example

python3 main.py "~/" "Documents/*"