Skip to content

Instantly share code, notes, and snippets.

@Himura2la
Himura2la / .gitlab-ci.yml
Last active April 28, 2024 08:36
MkDocs with plugins in GitLab CI (with apk and pip packages caching)
image: python:alpine
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
APK_CACHE_DIR: $CI_PROJECT_DIR/.cache/apk
PIP_PACKAGES:
mkdocs
mkdocs-material
mkdocs-git-revision-date-localized-plugin
cache:
paths:
@djfdyuruiry
djfdyuruiry / README.md
Last active April 28, 2024 08:34
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

# set your OPENAI_API_KEY in your .env
from openai.types.chat import ChatCompletionMessageParam
from mirascope.openai import OpenAICall
from dotenv import load_dotenv
load_dotenv()
class Librarian(OpenAICall):
prompt_template = """
SYSTEM: You are the world's greatest librarian.
MESSAGES: {history}
@maxlapshin
maxlapshin / capture_raw_frames.c
Created September 30, 2011 11:50
v4l2 capture example
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@gagarine
gagarine / fish_install.md
Last active April 28, 2024 08:27
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 08:34
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@tatsumoto-ren
tatsumoto-ren / subs.md
Last active April 28, 2024 08:24
Japanese Subtitles

📓 Table of Contents 📚 Resources ✉️ Chat


kitsunekko.net jp subtitles

A large repository of japanese subtitles that is updated reasonably often and has a clean design.| The most popular one, you can upload your own subs.| Often have to be retimed.

@Ashlyn-Joshy
Ashlyn-Joshy / expressError.js
Created April 28, 2024 08:20
Custom errors with node and express
class ExpressError extends Error {
constructor(message, status) {
super();
this.message = message;
this.status = status;
}
}
module.exports = ExpressError;

Comparing usage of Ash & Ecto

# https://gist.github.com/Gazler/b4e92e9ab7527c7e326f19856f8a974a

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, SamplePhoenix.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,