Skip to content

Instantly share code, notes, and snippets.

View pixelbrackets's full-sized avatar
🧑‍🎓
Looking at other things right now

Dan Kleine (geb. Dan Untenzu) pixelbrackets

🧑‍🎓
Looking at other things right now
View GitHub Profile
@pixelbrackets
pixelbrackets / composer-git-auth.md
Last active February 2, 2024 08:08
Manage GitHub & GitLab Credentials in Composer
@pixelbrackets
pixelbrackets / bash
Last active November 10, 2023 09:05
wget archive
### Mirror page (infinite recursion), download assets as well, add html extension to pagelinks, make links relative, wait one second after each request to avoid hitting rate limits, identify as archive crawler
wget --mirror --page-requisites --adjust-extension --convert-links --wait=1 --user-agent="Archive Crawler" https://www.example.com
### maybe you want/need to turn off checks for robots.txt as well: `--execute robots=off`
### Watch out for relative/absolute links, with or without www. Crawling »www.example.com«, but all links point to »example.com« will cause wget to mirror the first page URL ony, and not follow any more links.
### To allow multipe domains use `--span-hosts --domains=example.com,www.example.com,cdn.example.com`
@pixelbrackets
pixelbrackets / api.php
Last active October 27, 2023 19:13
Simple PHP script to test and use cURL
<?php
/**
* Simple request response script
*
* Point you cURL request to this script to see all incoming data
*/
echo '*API*'. PHP_EOL;
@pixelbrackets
pixelbrackets / .bash_aliases
Last active July 2, 2023 14:15
Bash Aliases
### path
alias sl='ls'
alias la='ls -alh'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
### git
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gls='git log -7 --oneline'
@pixelbrackets
pixelbrackets / swiftmailer.php
Last active April 26, 2023 07:26
PHP Mail Transport Test - Swiftmailer & Symfony Mailer standalone scripts, instantly usable without frameworks
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// composer require swiftmailer/swiftmailer
require_once 'vendor/autoload.php';
// Create the Transport
@pixelbrackets
pixelbrackets / bash
Last active November 13, 2022 03:46
wget crawler (e.g. simple cache warmup)
### crawls all links, writes the result to /tmp/ and deletes the files right away
wget --spider --force-html -r -l10 --directory-prefix=/tmp/ --no-directories --delete-after http://www.example.com
@pixelbrackets
pixelbrackets / gfm2html.sh
Last active September 16, 2022 03:13 — forked from evertton/gfm2html.sh
Convert a Github Flavored Markdown Syntax file to HTML./gfm2html <input> [stylesheet] > output
#!/bin/bash
# Convert a Github Flavored Markdown Syntax file to HTML
#
# The MIT License (MIT)
# Copyright © 2012 Evertton de Lima <e.everttonlima@gmail.com>
# http://evertton.mit-license.org/
# Stylesheet feature by Dan Untenzu <mail@pixelbrackets.de>
#
# Requirements: cURL (sudo apt-get install curl)
@pixelbrackets
pixelbrackets / git-add-all-remote.sh
Last active August 5, 2022 12:45
Add a Git remote named »all« which groups all existing remotes
#!/bin/bash
# Source: https://akrabat.com/git-push-to-multiple-repositories/
if [ "`git remote| grep all`" == "all" ] ; then
git remote remove all
fi
for r in `git remote`
do
@pixelbrackets
pixelbrackets / git-change-commit-date.sh
Last active April 10, 2022 18:13
Change date of a selected commit or all commits
#!/usr/bin/env bash
# Usage:
# ./git-change-commit-date.sh <commit id | 'all' >
# Example:
# ./git-change-commit-date.sh e119b94 # change commit with id e119b94
# ./git-change-commit-date.sh all # changes all commits
#
# Warning! rebase/filter will change the history
@pixelbrackets
pixelbrackets / PageHasTranslationViewHelper.php
Created September 13, 2016 14:09
TYPO3 ViewHelper to check if a given page is translated into a given language or is translated at all
<?php
namespace Pixelbrackets\AcmeExtension\ViewHelpers;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Checks if a given page is translated into a given language or translated at all
*
* = Examples =
*