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 / 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 / git-mirror-repository.sh
Last active August 28, 2020 12:51
Duplicate / Mirror a git repository to another without forking
#!/usr/bin/env bash
# Usage:
# ./git-mirror-repository.sh "<source repository URL>" "<target repository URL>"
# Example:
# ./mirror-gitlos-project.sh "git@gitlab.com:example/kickstart.git" "git@gitlab.com:example/acme.git"
#
# The user must have access to both existing repositories
#
# Warning! --mirror will do a force push - Use only once per project!
@pixelbrackets
pixelbrackets / guzzle-json-request.php
Last active May 15, 2020 15:21
Guzzle JSON Request Debugging
<?php
// composer require guzzlehttp/guzzle
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require __DIR__ . '/vendor/autoload.php';
@pixelbrackets
pixelbrackets / index.php
Last active September 2, 2020 12:46
waterpipe-example-api
<?php
require __DIR__ . '/../vendor/autoload.php';
/**
* Waterpipe: https://packagist.org/packages/elementaryframework/water-pipe
*
* Examples calls:
* http 127.0.0.1:8080/ # GET homepage
* http 127.0.0.1:8080/build/ token=foo # POST JSON Build endpoint
@pixelbrackets
pixelbrackets / robo-example-app.php
Last active January 16, 2020 10:37
Robo example app
<?php
require __DIR__ . '/vendor/autoload.php';
// Use Robo in standalone app
// https://robo.li/framework/#robo-as-a-framework
//
// - Install Robo `composer require consolidation/robo:^1.0`
// - Run app `php robo-example-app.php`
@pixelbrackets
pixelbrackets / IfNonEmptyViewHelper.php
Created March 29, 2019 11:15
TYPO3 Fluid ViewHelper to determine whether a variable is non empty
<?php
namespace Pixelbrackets\AcmeExtension\ViewHelpers;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
/**
* Determine whether a variable is non empty
*
* Non Empty Wording: https://english.stackexchange.com/a/102789
* Values considered as empty: https://www.php.net/manual/en/function.empty.php
@pixelbrackets
pixelbrackets / backup-acme.sh
Last active February 28, 2019 12:21
Backup Uberspace Projects
#!/bin/bash
# Backup Script for Uberspace 7 projects
USERLOCAL='johndoe' # Local Username
USERNAME='acme' # Uberspace Username
HOST='acme@foo.uberspace.de' # Uberspace Connection (Username@Host)
DATE=`date +%Y-%m-%d` # Current date
### Check if backup folder exists and create it
@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 / image.md
Created February 11, 2018 13:42
Create/ write images of SD-cards

Create/ write images of SD-cards

Detect SD card

# show SD card - something like /dev/XXXX e.g  /dev/sdb1
df –h
# unmount the card to prevent card access while writing the image 
umount /dev/XXXX

Write image to SD card

@pixelbrackets
pixelbrackets / notes.md
Last active December 3, 2021 14:39
999+ New Messages - How to handle information overload