Skip to content

Instantly share code, notes, and snippets.

View agrippa1994's full-sized avatar

Manuel Leitold agrippa1994

  • DCCS GmbH
  • Styria, Austria
View GitHub Profile
@rjpkuyper
rjpkuyper / dynamic.controller.ts
Created February 3, 2023 06:37
Dynamic controllers, an example.
// dynamic.controller.ts
export const createDynamicController = ({ customPath }): Type<any> {
@Controller()
class MyController {
constructor(private service: MyService) { }
@Get([customPath])
async getSomething(@Res() res: Response) {
//...
}
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active March 3, 2025 03:18
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@mcarlton00
mcarlton00 / Jellyfin-api-auth-example.py
Last active February 28, 2025 23:50
Example for authenticating to Jellyfin API from Python
import requests
# Define connection details
server_url = 'http://192.168.0.200:8096'
username = 'User'
password = 'Password'
# Build json payload with auth data
auth_data = {
'username': username,
@knolleary
knolleary / README.md
Last active February 15, 2023 18:46
Example Node-RED that adds a sidebar panel in the editor

Example Node-RED that adds a sidebar panel in the editor

  1. git clone this gist somewhere

  2. In ~/.node-red run: npm install <path to where the gist is>

  3. Restart Node-RED

  4. Reload the editor and marvel at the new sidebar tab

@tumainimosha
tumainimosha / page-info.ts
Last active November 22, 2024 12:37
NestJS Graphql Cursor Based pagination
import { ObjectType, Field } from "@nestjs/graphql";
@ObjectType()
export class PageInfo {
@Field({ nullable: true })
startCursor: string;
@Field({ nullable: true })
endCursor: string;

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active February 13, 2025 16:56
Building a react native app in WSL2
@cschiewek
cschiewek / x11_docker_mac.md
Last active February 25, 2025 13:22
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@david7482
david7482 / C++11_string_swtich.cpp
Last active December 14, 2023 21:09
Use C++11's constexpr to achieve string switch
// http://stackoverflow.com/a/107657
constexpr unsigned long long int HashStringToInt(const char *str, unsigned long long int hash = 0)
{
return (*str == 0) ? hash : 101 * HashStringToInt(str + 1) + *str;
}
void simple_switch(const std::string &str)
{
switch (HashStringToInt(str.c_str()))
{