Directly from CLI
alias x='exit'
funcsave x
or create a file in
~/.config/fish/functions
with name
| #!/bin/bash | |
| # Build latest version of Emacs, version management with stow | |
| # OS: Ubuntu 14.04 LTS | |
| # version: 24.5 | |
| # Toolkit: lucid | |
| # Warning, use updated version of this script in: https://github.com/favadi/build-emacs | |
| set -e |
| <?php namespace App\Providers; | |
| use Illuminate\Support\ServiceProvider; | |
| /** | |
| * If the incoming request is an OPTIONS request | |
| * we will register a handler for the requested route | |
| */ | |
| class CatchAllOptionsRequestsProvider extends ServiceProvider { |
| #!/bin/bash | |
| # Stop all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ] ; then | |
| docker stop $containers | |
| fi | |
| # Delete all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ]; then | |
| docker rm -f -v $containers |
| echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <ruleset name="Laravel and similar phpmd ruleset" | |
| xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
| xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
| <description> | |
| Inspired by https://github.com/phpmd/phpmd/issues/137 | |
| using http://phpmd.org/documentation/creating-a-ruleset.html | |
| </description> |
| [ | |
| { | |
| "code": "AF", | |
| "name": "Afghanistan" | |
| }, | |
| { | |
| "code": "AX", | |
| "name": "Aland Islands" | |
| }, | |
| { |
| Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if | |
| a form sits there for a while (like a login form, but any the same) the csrf token in the form will | |
| expire & throw a strange error. | |
| Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner. | |
| In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T! | |
| Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function. | |
| All of your exceptions go through here, unless you have excluded them in the $dontReport array at the |
| # Get last 100 log entries as a PowerShell object | |
| $gitHist = (git log --format="%ai`t%H`t%an`t%ae`t%s" -n 100) | ConvertFrom-Csv -Delimiter "`t" -Header ("Date","CommitId","Author","Email","Subject") | |
| # Now you can do iterate over each commit in PowerShell, group sort etc. | |
| # Example to get a commit top list | |
| $gitHist|Group-Object -Property Author -NoElement|Sort-Object -Property Count -Descending | |
| # Example do something for each commit | |
| $gitHist|% {if ($_.Author -eq "Mattias Karlsson") {"Me"} else {"Someone else"} } |
Directly from CLI
alias x='exit'
funcsave x
or create a file in
~/.config/fish/functions
with name