Skip to content

Instantly share code, notes, and snippets.

View floriankraemer's full-sized avatar

Florian Krämer floriankraemer

View GitHub Profile
@floriankraemer
floriankraemer / install-php.sh
Last active May 3, 2024 17:52
PHP installer script for Ubuntu
#!/usr/bin/env bash
# https://computingforgeeks.com/how-to-install-php-on-ubuntu/
phpVersions=('8.1')
modules=('zip' 'cli' 'fpm' 'bcmath' 'gd' 'xml' 'mbstring' 'xml' 'curl' 'pgsql' 'mysql' 'imagick' 'intl' 'amqp' 'intl' 'imap' 'opcache' 'redis', 'dom')
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
@burzum
burzum / install-phps.sh
Last active January 6, 2021 09:21
Install php versions and modules automatically on Ubuntu
#!/usr/bin/env bash
# https://computingforgeeks.com/how-to-install-php-on-ubuntu/
phpVersions=('7.2' '7.3' '7.4')
modules=('cli' 'fpm' 'bcmath' 'gd' 'xml' 'mbstring' 'xml' 'curl' 'pgsql' 'imagick' 'intl' 'amqp' 'intl' 'imap' 'opcache')
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
@k1paris
k1paris / Law-of-Demeter-with-PHP.md
Last active February 12, 2025 21:19
Law of Demeter with PHP (LoD)

Law of Demeter with PHP (LoD)

Law of Demeter or principle of least knowledge is a design guideline, that is using to make code more simple and stable.

Rules for module

  • Each unit should have only limited knowledge about other units: only units "closely" related to the current unit.
  • Each unit should only talk to his friends; don't talk to strangers.
  • Only talk to your immediate friends.
@straker
straker / two-way-binding.js
Last active October 14, 2024 19:31
Simple and small two-way data binding between DOM and data
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes