Skip to content

Instantly share code, notes, and snippets.

Avatar
😷
Wear a mask

Dan Untenzu pixelbrackets

😷
Wear a mask
View GitHub Profile
@pixelbrackets
pixelbrackets / README.md
Last active Feb 10, 2022
Composer Test Dev Depdendency
View README.md

ACME DevTool

A package intended for usage during development

image

@pixelbrackets
pixelbrackets / main.yaml
Created Feb 1, 2022
php-version-pickup Ansible Role
View main.yaml
---
- name: Download/Update php-version-pickup
git:
repo: https://github.com/webit-de/php-version-pickup.git
dest: /home/{{ username }}/.php-version-pickup
clone: yes
update: yes
- name: Source script
@pixelbrackets
pixelbrackets / composer.json
Last active Feb 10, 2022
php-version-pickup
View composer.json
{
"name": "pixelbrackes/php-version-pickup",
"description": "Set a PHP version used in a shell session through a `.php-version` file",
"type": "project",
"license": "GPL-2.0-or-later"
}
@pixelbrackets
pixelbrackets / php-password-hash
Created Sep 7, 2021
PHP Password Hash Creator
View php-password-hash
#!/usr/bin/env php
<?php
echo 'Password: ' . PHP_EOL;
fscanf(STDIN, '%s', $password);
$passwordHash = password_hash($password, PASSWORD_ARGON2I);
echo 'Hash: ' . PHP_EOL;
echo $passwordHash . PHP_EOL;
$result = password_verify($password, $passwordHash);
@pixelbrackets
pixelbrackets / pass-php-version-to-subscripts-in-cli-calls.md
Last active Feb 10, 2022
Pass a specific PHP version to subscripts in a CLI call
View pass-php-version-to-subscripts-in-cli-calls.md

Pass a specific PHP version to subscripts in a CLI call

Origin

Using the PPA ondrej/php it is possible to run multiple PHP version on one system.

All single versions are useable on the CLI, e.g. php7.4 --version. The command php will point to the default version.

Problem

@pixelbrackets
pixelbrackets / composer-git-auth.md
Last active Oct 15, 2021
Manage GitHub & GitLab Credentials in Composer
View composer-git-auth.md
@pixelbrackets
pixelbrackets / date-prototype.html
Created Feb 25, 2021
Date Formats (2017-02-21)
View date-prototype.html
Valid till: <span class="datetime" data-datetime="2017-02-21 17:00">2017-02-21 17:00 (GMT)</span>
<script>
// Given: Date and time in UTC timezone and international format
// Returned: Date and time in local timezone and international format
// Note: Returning localised date formats is not possible in JavaScript
// without the help of a library like moment.js!
// Extend date object with format method
@pixelbrackets
pixelbrackets / test-firewall.php
Created Feb 25, 2021
Test Firewall - Minimal script to prove to hosters that access to certain domains is not possible
View test-firewall.php
<?php
// composer require guzzlehttp/guzzle
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['timeout' => 2]);
$urls = [
@pixelbrackets
pixelbrackets / .gitlab-ci.yml
Created Dec 2, 2020
Minimal GitLab CI file to test a pipeline setup
View .gitlab-ci.yml
job1:
script: 'echo Hello GitLab CI'
@pixelbrackets
pixelbrackets / ci-minimal-smoketest.yml
Created Dec 1, 2020
CI minimal smoketest with cURL
View ci-minimal-smoketest.yml
job_test_app_smoketest:
stage: test
script:
- curl -s --fail --show-error https://example.com/