Skip to content

Instantly share code, notes, and snippets.

View samzzi's full-sized avatar

Sam Serrien samzzi

View GitHub Profile
@lukaskleinschmidt
lukaskleinschmidt / Menu.php
Last active March 1, 2024 15:57
Kirby 4 Panel Menu
<?php
namespace App;
use Closure;
use Kirby\Cms\App;
class Menu
{
public static array $pages = [];
@lukaskleinschmidt
lukaskleinschmidt / LICENSE.md
Last active April 14, 2024 14:26
Kirby 3 Synced Structure

MIT License

Copyright (c) 2023 Lukas Kleinschmidt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT

@rasteiner
rasteiner / release-plugin.php
Created October 5, 2022 12:43
kirby cli plugin version bump command
<?php
return [
'description' => 'Release a new version of your plugin',
'args' => [
'bump' => [
'description' => 'The type of version bump to perform',
],
],
'command' => static function ($cli): void {
@rasteiner
rasteiner / i.php
Created October 3, 2022 16:01
Interactive shell for kirby cli
<?php
namespace rasteiner\kirby\cli\interactive;
class Shell {
public function __autocomplete(string $str): array {
$info = readline_info();
$line = $info['line_buffer'];
$pos = $info['end'];
$line = substr($line, 0, $pos);
@arthurpalves
arthurpalves / close_issue.yml
Created February 11, 2021 17:51
Close Github Issues when the corresponding Project Card is moved to column "Done"
name: "Close issue"
on:
project_card:
types: [moved]
jobs:
close-issue:
name: "Close issue when card moves to Done column"
runs-on: ubuntu-latest
@jakebathman
jakebathman / logslaravel.sh
Created August 19, 2018 00:06
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@kocisov
kocisov / next_nginx.md
Last active July 28, 2024 09:17
How to setup next.js app on nginx with letsencrypt
@mrkpatchaa
mrkpatchaa / README.md
Last active June 6, 2024 21:03
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@ddeveloperr
ddeveloperr / git_push_force_upstream.md
Last active September 6, 2023 15:52
How to force “git push” to overwrite remote repo files WITH LOCAL files

You want to push your local files to remote files

git push -f <remote> <branch>
git push -f origin master

Local version has priority over the remote one!

more...

@bastianallgeier
bastianallgeier / controllers--contact.php
Created October 1, 2014 19:36
Plain contactform example for Kirby 2
<?php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),