git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
<?php | |
namespace Ormigo\Bundle\OrmigoBundle\Form\Model; | |
use DateTime; | |
class DateRange | |
{ | |
/** | |
* @var DateTime |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
########################################## | |
# To run: | |
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x | |
########################################## | |
# Check that HTTPS transport is available to APT | |
if [ ! -e /usr/lib/apt/methods/https ]; then | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https | |
fi |
<?php | |
namespace OpenObjects\Bundle\CoreBundle\Service; | |
use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper; | |
use Symfony\Component\Form\Form; | |
use Symfony\Component\Form\FormError; | |
use Symfony\Component\Validator\ConstraintViolation; | |
/** |
WordPress is popular because it's easy to setup without much technical know-how. However, to build a more robust PHP project with command line deployments, updates and ongoing maintenance, working with WordPress out-of-the-box raises specific challenges:
# Docker-Compose shortcut: | |
# - before: docker-compose exec app <command> | |
# - after: d <command> | |
# The alias will auto-start the service if it is stopped. | |
# Requirements: | |
# - jq: https://stedolan.github.io/jq/ | |
# - yq: https://github.com/kislyuk/yq | |
# Add this to your `~/.zshrc` at the end because `d` is an existing (unrelated) alias we want to override |
#!/bin/bash | |
# This script requires jq, a command line to to parse and format JSon. | |
# https://stedolan.github.io/jq/ | |
function padBase64 { | |
STR=$1 | |
MOD=$((${#STR}%4)) | |
if [ $MOD -eq 1 ]; then | |
STR="${STR}=" |
<?php | |
const STREAM_OPEN_FOR_INCLUDE = 128; | |
final class HardCoreDebugLogger | |
{ | |
public static function register(string $output = 'php://stdout') | |
{ | |
register_tick_function(function () use ($output) { | |
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |