Skip to content

Instantly share code, notes, and snippets.

View stefanzweifel's full-sized avatar
🎯
Focusing

Stefan Zweifel stefanzweifel

🎯
Focusing
View GitHub Profile
@stefanzweifel
stefanzweifel / composer.json
Created February 15, 2021 19:04
A PHP script to rename a collection of Zettelkasten notes into a different format. I've used this script to rename my notes, so that the timestamp/ID is always at the front.
{
"require": {
"illuminate/collections": "^8.26",
"illuminate/support": "^8.26",
"symfony/var-dumper": "^5.2"
}
}
@stefanzweifel
stefanzweifel / content-standards.yml
Created March 5, 2021 18:53
GitHub Actions workflow to run `alex`
name: "Content Standards"
on:
pull_request: null
push:
branches:
- "main"
jobs:
content-standards:
@stefanzweifel
stefanzweifel / deploy.yml
Created April 12, 2021 11:05
A very very very simple approach to start a deployer deployment through GitHub Actions.
name: Deployment
on:
repository_dispatch:
types: ['deploy']
workflow_dispatch:
inputs:
deploy_host:
description: 'Environment'
required: true
@stefanzweifel
stefanzweifel / CustomParser.php
Created April 15, 2021 18:18
A Custom Markdown Parser for Jigsaw projects.
<?php
namespace App\Markdown;
use Illuminate\Container\Container;
use League\CommonMark\Block\Element\FencedCode;
use League\CommonMark\Block\Element\IndentedCode;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Extension\ExternalLink\ExternalLinkExtension;
#!/bin/bash
set -e
# NOTE to create labels for your repo
# to support types from commit message guide (feat, fix, docs, style, refactor, test, chore)
# by hitting GitHub API v3
#
# https://developer.github.com/v3/issues/labels/#create-a-label
# https://gist.github.com/caspyin/2288960
@stefanzweifel
stefanzweifel / update-changelog-laravel.yaml
Created February 19, 2022 10:36
GitHub Actions workflow tailored to the workflow the Laravel org uses to release new versions of their projects.
name: "Update Changelog"
on:
release:
types: [released]
jobs:
update:
runs-on: ubuntu-latest
@stefanzweifel
stefanzweifel / UseCarbonImmutableInAppServiceProviderRector.php
Created January 4, 2023 19:46
Rector Rule to enable ImmutableDates in Laravel by updating the AppServiceProvider
<?php
namespace App\Rector;
use PhpParser\Node;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
@stefanzweifel
stefanzweifel / fetch-github-repo-dependants.js
Created December 18, 2023 18:25
JavaScript function to cycle through the "Dependents" off a GitHub repository and create a collection of repos with the most stars.
function $$(selector, scope = document) {
return Array.from(scope.querySelectorAll(selector));
}
const stats = [];
const threshold = 100;
function processPage() {
let buttons = $$('a.btn');
let nextButton = buttons.find(function (button) {