Skip to content

Instantly share code, notes, and snippets.

@AVTaran
AVTaran / script.sh
Created February 11, 2025 18:38 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
func deleteProject(client *gitlab.Client, projectPath string, permanent bool) error {
// Step 1: Fetch project details
project, _, err := client.Projects.GetProject(projectPath, nil)
if err != nil {
return fmt.Errorf("failed to retrieve project details: %w", err)
}
if permanent {
// Step 2: Permanently remove the project if it's marked for deletion
if !project.MarkedForDeletionAt.IsZero() {
@Redestros
Redestros / Program.cs
Last active February 11, 2025 18:39
Dotntet Manual mapping of access token role claim to Identity roles
builder.Services
.AddAuthentication()
.AddJwtBearer(options =>
{
options.Authority = "http://localhost:8080/realms/client";
options.RequireHttpsMetadata = false;
options.TokenValidationParameters = new TokenValidationParameters
{
RoleClaimType = "custom-claim",
ValidateIssuerSigningKey = true,
@diek
diek / drivers.py
Last active February 11, 2025 19:31
Add drivers
from formulaone.models import Circuit, Constructor, Driver, IncidentReport, Race, Result, Status
# Shell Plus Django Imports
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import transaction
from django.db.models import Avg, Case, Count, F, Max, Min, Prefetch, Q, Sum, When
from django.utils import timezone
from django.urls import reverse
from django.db.models import Exists, OuterRef, Subquery
@Schoolads
Schoolads / gist:8e0b3cf1ce0ebddaf34605ff936bbd6f
Created February 11, 2025 18:34
School of Nursing, Osogbo 2025/2026 {O8125777035} Admission Form Is STILL ON SALE.. Call DR.MRS ALICE OGUNSOLA on {O8125777035}.The Management of the school hereby inform the general public of the sales of the general Nursing Admission form into the School of Nursing, Also midwifery, post-basic midwifery form, post-basic nursing form and interns…
School of Nursing, Osogbo 2025/2026 {O8125777035} Admission Form Is STILL ON SALE.. Call DR.MRS ALICE OGUNSOLA on {O8125777035}.The Management of the school hereby inform the general public of the sales of the general Nursing Admission form into the School of Nursing, Also midwifery, post-basic midwifery form, post-basic nursing form and internship form are still on sale for more information on purchase of the form and admission assistance call Admin Officer{O8125777035}
@AlviseDeFaveri
AlviseDeFaveri / console.py
Created February 11, 2025 18:34 — forked from j1o1h1n/console.py
This is a demo of an interactive console in a Textual user interface.
# Variation of https://gist.github.com/j1o1h1n/2e8eea722a3a71d3190517a33569df57
from __future__ import annotations
import string
import code
import sys
import io
from typing import Callable
using System;
namespace ConsoleApp4;
class Program
{
static void Main(string[] args)
{
const string CommandSum = "Sum";
const string CommandExit = "Exit";
@wilmoore
wilmoore / readme.md
Created February 11, 2025 18:34
Song Link Translator

Use the given screenshot to extract the song title and artist. It should be obvious which song it is because the screenshot should depict either a single song or in cases where there’s more than one song, use the song that is selected and/or currently playing.

Next, craft direct song URLs (not search links) and render them as clickable links for the following platforms:

  • Spotify
  • YouTube
  • SoundCloud
  • Apple Music

If the song is unavailable on any of these platforms, note that explicitly. If direct links cannot be generated for any reason, explain why and provide a solution.

@aniongithub
aniongithub / .bash_aliases
Last active February 11, 2025 18:43
Add a shareable monitor to the lower left of a 4K (2160p) monitor with xrandr
# Save this to your ~/.bash_aliases file or ~/.bashrc directly
alias add-monitor="xrandr --setmonitor screenshare 1920/1x1080/1+0+1080 none"
alias remove-monitor="xrandr --delmonitor screenshare"
@usrbinkat
usrbinkat / README.md
Created February 11, 2025 18:32
Manually Build & Publish multi-arch ghcr.io Containers in Github Codespaces

Install Packages

sudo apt-get update
sudo apt-get install -y qemu-user-static

Create a new builder instance and use it