git config --global core.whitespace cr-at-eol
git config --global core.autocrlf true
This file contains hidden or 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
#!/bin/bash | |
# First things first | |
current=`git branch | grep \* | cut -d ' ' -f2` | |
git fetch --all | |
# Once we know all the remote branches | |
remoteprefix='remotes/' | |
branchprefix='remotes/origin/' | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do |
From http://stackoverflow.com/a/10489580
-
Match the first 18 chars from a given string
potato
on filefoo.txt
egrep -Rso 'potato".{0,18}' foo.txt
Tired to forget to write every goddam time the branch name on the commit messsage? This got you covered:
- Add the prepare-commit-msg file to your
.git/hooks/
folder; - Then,
chmod +x prepare-commit-msg
; - PROFIT!
This file contains hidden or 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 | |
namespace \Json | |
class Helper | |
{ | |
/** | |
* @var array | |
*/ | |
protected $errorReference = [ |
This file contains hidden or 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
version: '2' | |
services: | |
nginx: | |
image: nginx:latest | |
ports: | |
- "777:80" | |
networks: | |
- main |
From https://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit (with few changes on the end by me 😉)
# Switch to the master branch and make sure you are up to date.
git checkout master
git fetch # this may be necessary (depending on your git config) to receive updates on origin/master
git pull
This file contains hidden or 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
#!/bin/bash | |
set -e | |
show_help() { | |
cat << EOF | |
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE] | |
${0##*/} -h | |
Open a standard connection in Sequel PRO. |
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
colors="true"
as found on StackOverflow
And this command to restart my php-fpm:
brew services restart php56