Skip to content

Instantly share code, notes, and snippets.

View svenluijten's full-sized avatar

Sven Luijten svenluijten

View GitHub Profile
[user]
useConfigOnly = true
# name = Robin Hood
# email = your-email@example.com
signingkey = <gpg signing key>
[alias]
st = "status"
lg = log --graph --date=human --pretty=default
df = "diff --"
#
# Available at https://git.io/sven-git-aliases
#
# run "curl -fsSL https://git.io/sven-git-aliases | sh" to apply these automagically.
#
git config alias.st "status -sb"
git config alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
git config alias.df "diff --"
git config alias.branch-name "rev-parse --abbrev-ref HEAD"
git config alias.find = "log --pretty=\"format:%Cblue%H %Cgreen%s%Creset\" --abbrev-commit --grep"
@svenluijten
svenluijten / extra-assertions.php
Last active March 28, 2018 13:07
extra assertions against arrays
<?php
namespace Tests;
use Illuminate\Support\Str;
use PHPUnit\Framework\TestCase as BaseTestCase;
class TestCase extends BaseTestCase
{
/**
@svenluijten
svenluijten / _index.md
Last active June 22, 2017 11:35
Handy bash functions I commonly use

"dotfiles"

A collection of my "dotfiles" on Windows. I use this in combination with Cmder with a git bash shell.

@svenluijten
svenluijten / php.ini
Created June 26, 2016 14:44
My php.ini file. Read how to install & configure PHP on Windows here:
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
{
"bold_folder_labels": false,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/OLD/Material-Theme-Darker.tmTheme",
"detect_indentation": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
<?php
class Database {
// Properties:
private $host;
private $dbname;
private $user;
private $pass;
private $error;
private $stmt;
@svenluijten
svenluijten / php.ini
Created February 17, 2016 11:20
My php.ini file
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@svenluijten
svenluijten / nginx.conf
Created January 27, 2016 13:48
Brilliant nginx config redirecting to non-www https by @jaw-sh.
server {
listen 80 default_server; # Listen for regular HTTP requests
listen [::]:80 default_server; # Handle requests over IPv6
server_name _; # Respond to any and all server_names
return 301 https://$host$request_uri; # Redirect to https
}
server {
@svenluijten
svenluijten / AuthController.php
Last active January 7, 2016 11:13
My authentication
<?php
/**
* Log a player in.
*
* @param LoginPlayerRequest $request
* @return \Illuminate\Http\Response
*/
public function auth(LoginPlayerRequest $request)
{
// The user supplied the wrong credentials.