Skip to content

Instantly share code, notes, and snippets.

View thinkverse's full-sized avatar
🦖

Kim Hallberg thinkverse

🦖
View GitHub Profile
@whitep4nth3r
whitep4nth3r / gist:e6b10ef17636e29010d7a8b57800685e
Created May 5, 2021 12:13
Delete all branches merged into main
// Add to your shell configuration to improve your life!
dam() {
git checkout main && git branch --merged | egrep -v "(^\*|main)" | xargs git branch -d
}
@thinkverse
thinkverse / gallery.css
Last active June 8, 2021 02:59
Single-line images gallery with `array_*` functions and `scandir`.
@Illizian
Illizian / DateTimeComponent.php
Last active September 28, 2021 14:05
Laravel localised DateTimes with UTC Database storage
<?php
namespace App\View\Components;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Carbon;
use Illuminate\View\Component;
class DateTime extends Component
{
@valorin
valorin / .env.example
Last active December 24, 2024 18:18
CSP Middleware - the simple CSP middleware I use across all of my projects.
# Add to your .env.example and .env files
CSP_ENABLED=true
CSP_REPORT_ONLY=true
# 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)
@emilyliu7321
emilyliu7321 / bluesky-comments.tsx
Created November 25, 2024 05:39
Integrate Bluesky replies as your blog's comment section
"use client";
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { useState, useEffect } from 'react';
import {
AppBskyFeedDefs,
AppBskyFeedPost,
type AppBskyFeedGetPostThread,
} from "@atproto/api";