Skip to content

Instantly share code, notes, and snippets.

View Maxiviper117's full-sized avatar
🎯
Focusing

David Maxiviper117

🎯
Focusing
View GitHub Profile
# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@dhh
dhh / linux-setup.sh
Last active April 28, 2025 16:30
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@Maxiviper117
Maxiviper117 / color-shades-generator.scss
Last active March 14, 2024 16:01
SCSS Color Shades Generator: Dynamic CSS Variable Creation for Theming
// Import the Sass math module for division and other mathematical operations
@use "sass:math";
// Function to generate a series of color shades from a base color
@function generate-shades($base-color) {
// Initialize an empty map to store the shades
$shades: ();
// Define the scale for the shades
$scale: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950);
@jo-chemla
jo-chemla / kapture-cropper.py
Last active March 5, 2025 18:28
Quick utility to crop a kapture images and adapt intrinsics
# py kapture-cropper.py -i dataset-kapture\ --border_px 0 --scale_factor 1 -v
import kapture
import kapture.io.csv as csv
from PIL import Image
from kapture.io.csv import kapture_to_dir
import os, logging, argparse
import kapture.utils.logging
logger = logging.getLogger("kapture-cropper")
from langchain.chat_models import ChatOpenAI
from pydantic import BaseModel, Field
from langchain.document_loaders import UnstructuredURLLoader
from langchain.chains.openai_functions import create_extraction_chain_pydantic
class LLMItem(BaseModel):
title: str = Field(description="The simple and concise title of the product")
description: str = Field(description="The description of the product")
def main():
@chunibyo-wly
chunibyo-wly / Meshroom2Colmap.py
Last active June 5, 2024 08:16
convert meshroom structure from motion results to colmap format
import json, os, shutil
from os.path import join, basename
from tqdm import tqdm
import numpy as np
MESHROOM = r"E:\workspace\dataset\01_DTU\cache\20\meshroom\MeshroomCache\ConvertSfMFormat\4b9ced4a64f3f996f7650f3d5ed9e27c4774a7c9\sfm.json"
COLMAP = r"E:\workspace\dataset\01_DTU\cache\20\colmap"
def make_dir(folder):
@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active March 16, 2025 13:26
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@href
href / dict_namedtuple.py
Created October 27, 2011 12:00
Convert any dictionary to a named tuple
from collections import namedtuple
def convert(dictionary):
return namedtuple('GenericDict', dictionary.keys())(**dictionary)
"""
>>> d = dictionary(a=1, b='b', c=[3])
>>> named = convert(d)
>>> named.a == d.a
True
>>> named.b == d.b