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
call plug#begin('~/.vim/plugged') | |
Plug 'sheerun/vim-polyglot' | |
Plug 'editorconfig/editorconfig-vim' | |
Plug 'ctrlpvim/ctrlp.vim' | |
Plug 'justinmk/vim-sneak' | |
Plug 'lambdalisue/vim-gista' | |
Plug 'tpope/vim-sensible' | |
Plug 'jremmen/vim-ripgrep' |
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
File: AuthServiceProvider | |
public function boot() | |
{ | |
$this->registerPolicies(); | |
Gate::define('update-product', function(User $user, Product $product) { | |
return $product->user->is($user); | |
}); | |
} |
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
# remove file form a commit | |
$git reset HEAD^ path/to/file/to/revert | |
$git commit --amend | |
# add file to a commit | |
$git add path/to/file/to/add | |
$git commit --amend |
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 | |
/** | |
* Refactor #1: | |
*/ | |
// Before | |
if ($user->type === 'admin' || $user->type === 'mod' || $user->type === 'author') { | |
// Do something. | |
} |
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
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = function(name, fn) { |
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
Mozilla SSH | |
Link: https://infosec.mozilla.org/guidelines/openssh |
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
//app/Http?Kernel.php | |
'web' => [ | |
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class, | |
] | |
// resources/js/bootstrap.js | |
window.axios.interceptors.response.use(undefined, function(error) { | |
switch(error.response.status) { |
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
COPIED FROM:- https://gist.githubusercontent.com/adamwathan/3584d1904e4f4c36096f/raw/66b5205fe189203b044eb0988b4fc0920bab897b/v-cloak.md | |
================================================================================= | |
Handy helpers for controlling visibility of elements until Vue has compiled. | |
Use like: | |
```html | |
<div v-cloak> |
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
Hierarchical-recursive-query |