Skip to content

Instantly share code, notes, and snippets.

View radermacher's full-sized avatar

Richard Radermacher radermacher

View GitHub Profile
@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
@stenuto
stenuto / convert.sh
Created May 29, 2024 03:45
Convert video file into HLS playlist with multiple resolutions and bitrates
#!/bin/bash
# This script takes a video file as input and converts it into an HLS (HTTP Live Streaming) playlist with multiple resolutions and bitrates. It also generates a thumbnail image from the video.
# Check if an input filename is provided
if [ -z "$1" ]; then
echo "Usage: $0 input_filename (without extension) [-t]"
exit 1
fi
@Sh4yy
Sh4yy / clx.go
Created April 25, 2024 20:39
Generate CLI commands for common tasks.
package main
import (
"context"
"errors"
"fmt"
"io"
"log"
"os"
"runtime"
@b-nnett
b-nnett / boost.js
Created April 18, 2023 15:47
Arc ChatGPT Boost
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function fillQuery() {
question = window.location.search.split("=")[1].replace("+", " ").replace("%3F", "?").replace("%27", "'")
var input = document.getElementsByTagName("textarea")[0]
await sleep(1000); // Pause for 1 second
input.textContent = question
// input.innerText = question
<?php
function memoize($target) {
static $memo = new WeakMap;
return new class ($target, $memo) {
function __construct(
protected $target,
protected &$memo,
) {}
@pascalbaljet
pascalbaljet / SwapOctaneServer.php
Last active July 8, 2024 18:12
Blue-green deployment with Laravel Octane
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Concerns\CallsCommands;
use Illuminate\Support\Facades\Http;
use Laravel\Forge\Forge;
use Laravel\Forge\Resources\Daemon;
@jacksleight
jacksleight / CustomNav.php
Last active January 27, 2022 17:49
Statamic Nav Performance Experiment
<?php
namespace App\Tags;
use Statamic\Tags\Tags;
use Statamic\Contracts\Structures\Structure as StructureContract;
use Statamic\Facades\Site;
use Statamic\Facades\URL;
use Statamic\Structures\TreeBuilder;
use Statamic\Facades\Data;
@mnapoli
mnapoli / README.md
Last active October 22, 2021 17:13
PrettyCI migration

This page will help you run continuous integration for PHP CodeSniffer and PHP-CS-Fixer using GitHub Actions.

To setup GitHub Actions in your repository, create a .github/workflows/ci.yml file in your repository and commit it.

The content of that file depends on the tool you want to run, please read the examples below.

Note: the examples below are provided to get you started easily, it is possible you may need to adjust them to fit your project.

php-cs-fixer

@julienbourdeau
julienbourdeau / kimsufi-notifier.php
Created August 13, 2017 05:34
Kimsufi notifier
<?php
$url = "https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2?callback=Request.JSONP.request_map.request_0";
$content = file_get_contents($url);
$content = substr($content, strlen("Request.JSONP.request_map.request_0("));
$content = substr($content, 0, strlen($content) - 2);
$content = json_decode($content);
@ramon-villain
ramon-villain / ThemosisValetDriver.php
Last active July 31, 2020 21:09
Themosis 1.3 Valet Driver
<?php
class ThemosisValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri