It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
cordova = "!f(){ MESSAGE=\"Build assets for deployment\"; [ \"$(git log -1 HEAD --pretty=format:%s)\" != \"$MESSAGE\" ] && git allclean && cordova prepare --release && git add -A && git commit -m \"$MESSAGE\" && git push || echo \"Commit already present\"; }; f" | |
fetch-pr = "!f(){ git fetch origin refs/pull/$1/head:pr/$1; }; f" | |
cleanup = !git clean -df | |
quick-clean = !git checkout . & git cleanup | |
all-clean = !git reset --hard && git cleanup | |
swap-last = !git tag _invert && git reset --hard HEAD~2 && git cherry-pick _invert _invert~1 && git tag -d _invert | |
invert-index = !git commit -m tmp1 && git add -A && git commit -m tmp2 && git swap-last && git reset HEAD~1 && git reset HEAD~1 --soft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A Declarative Pipeline is defined within a 'pipeline' block. | |
pipeline { | |
// agent defines where the pipeline will run. | |
agent { | |
// This also could have been 'agent any' - that has the same meaning. | |
label "" | |
// Other possible built-in agent types are 'agent none', for not running the | |
// top-level on any agent (which results in you needing to specify agents on | |
// each stage and do explicit checkouts of scm in those stages), 'docker', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see https://github.com/cmaessen/docker-php-sendmail for more information | |
FROM php:5-fpm | |
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/* | |
RUN docker-php-ext-install mysql mysqli sysvsem | |
RUN pecl install xdebug-2.5.5 \ | |
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Foundation\Testing\WithoutMiddleware; | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
class ExamplePassportTest extends \PassportTestCase | |
{ | |
use DatabaseTransactions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use this to help determine which images are being used | |
* at which breakpoint. Will print lots of useful information | |
* on shown resolution, actual resolution, DPR and more | |
* Usage: | |
* var elems = document.querySelectorAll('.c-hero-banner__background img') | |
* responsiveImageDebugOutput(elems); | |
* | |
* Author: Carl-Erik Kopseng | |
* Source: https://gist.github.com/fatso83/55fc446df3f3965ecd66e8307a5dc0e6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# List alias commands | |
la = "!git config -l | grep alias | cut -c 7-" | |
list-alias = "!git la" | |
# List commits in increasing detail | |
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
lll = log -u | |
# Most common diffs | |
diffc = diff --cached HEAD^ |
This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254
as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254
.
Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host
.
Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...
#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.
Run the following commands in sequence.
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
NewerOlder