Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stenuto
stenuto / gather.js
Last active January 16, 2025 17:02
A simple script to gather, annotate, and copy code to your clipboard
#!/usr/bin/env node
/**
* gather.js
*
* A CLI tool to gather code files from given directories/files, annotate them,
* and copy the resulting annotated code blob into the clipboard.
*
* Usage:
* node gather.js relative/path/to/dir relative/path/to/file.js ...
@MrPunyapal
MrPunyapal / GenerateTests.php
Last active February 21, 2025 02:03
Artisan Command for Generating Test Files in Laravel
<?php
Artisan::command('generate-tests', function () {
// Define the base path where class files are located
$files = File::allFiles(base_path('app/Classes'));
foreach ($files as $file) {
// Get the relative path of the current class file and apply string manipulations
$path = str($file->getRelativePathname())
->replace('.php', '') // Remove the .php extension
->replace('/', '\\') // Replace directory slashes with namespace slashes
@stenuto
stenuto / timelapse.sh
Created June 18, 2024 20:56
Timelapse script
#!/bin/bash
# Check if interval argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 -int <interval_in_seconds>"
exit 1
fi
# Extract the interval value
interval=$2
@simonhamp
simonhamp / LocalValetDriver.php
Last active November 18, 2024 08:54
Run anything you like through Laravel Herd
<?php
use Valet\Drivers\ValetDriver;
class LocalValetDriver extends ValetDriver
{
public function serves(string $sitePath, string $siteName, string $uri): bool
{
return true;
}
@jordienr
jordienr / tailwind.config.ts
Created July 15, 2023 09:10
Tailwind SVG Grid Background
// Remember to install mini-svg-data-uri
// Follow me on twitter for memes @jordienr
import { type Config } from "tailwindcss";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
const svgToDataUri = require("mini-svg-data-uri");
export default {
@lxe
lxe / README.md
Last active March 12, 2025 13:55
How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.

How to get oobabooga/text-generation-webui running on Windows or Linux with LLaMa-30b 4bit mode via GPTQ-for-LLaMa on an RTX 3090 start to finish.

This guide actually works well for linux too. Just don't bother with the powershell envs

  1. Download prerequisites

  2. (Windows Only) Open the Conda Powershell.

export default defineConfig({
plugins: [
laravel(['resources/js/app.js']),
{
name: 'ziggy',
enforce: 'post',
handleHotUpdate({ server, file }) {
if (file.includes('/routes/') && file.endsWith('.php')) {
exec('php artisan ziggy:generate', (error, stdout) => error === null && console.log(` > Ziggy routes generated!`))
}
@reinink
reinink / inertia-attribute.js
Last active June 14, 2022 03:29
Global Inertia.js click event handler
import { Inertia } from '@inertiajs/inertia'
document.addEventListener('click', (event) => {
if (
event.target.tagName.toLowerCase() === 'a' &&
event.target.hasAttribute('inertia') &&
!event.target.isContentEditable &&
!event.defaultPrevented &&
!event.shiftKey &&
!event.ctrlKey &&
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Colored Text Generator</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Colored Text Generator">
<meta name="author" content="rebane2001">
<style>
/*