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 | |
#modifed version of https://gist.github.com/pitch-gist/2999707 | |
//by twitter/abdu1m | |
#htaccess: | |
// RewriteCond %{REQUEST_URI} !/maintenance.php$ | |
// RewriteCond %{HTTP:X-FORWARDED-FOR} !=151.254.68.111 #this is your ip | |
// RewriteRule $ /maintenance.php [R=302,L] | |
?> | |
<!doctype html> |
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 | |
//the middleware | |
$middleware1 = function ($request, $carry) { | |
echo "first middleware \n"; | |
return $carry($request); | |
}; |
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 | |
/* | |
* Improved version of Collection->map method | |
* | |
* @param callable $callback | |
* | |
* @return Illuminate\Support\Collection | |
*/ | |
Illuminate\Support\Collection::macro('loop', function(callable $callback){ |
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 | |
/** | |
* drop the first or last {$limit} items. | |
* | |
* @param int $limit | |
* @return Illuminate\Support\Collection | |
*/ | |
Illuminate\Support\Collection::macro('drop', function(int $limit){ | |
if ($limit < 0) { | |
return $this->slice(0, $limit); |
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
## | |
# git hook to run a command after `git pull` for laravel by @abdu1m | |
## | |
# source: https://gist.github.com/sindresorhus/7996717 | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} |
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
<template> | |
<transition name="modal" v-if="toggled"> | |
<div class="fixed z-50 pin-t pin-l w-full h-screen bg-grey overflow-y-scroll flex" style="background-color: rgba(0, 0, 0, .5);"> | |
<div class="p-3 m-auto" :class="{'w-full': width!='auto'}"> | |
<div id="modalBox" class="md:mx-auto p-4 md:p-8 bg-white border rounded border-grey-darkest shadow-lg" :class="{'w-full md:w-1/3':width === 'small', 'w-full md:w-5/6': width === 'large', 'inline-block': width === 'auto'}"> | |
<div class="modal-header flex justify-center mb-2 text-center "> | |
<slot name="header"></slot> | |
</div> |
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "cmd+enter", | |
"command": "editor.action.showContextMenu", | |
"when": "editorTextFocus" | |
}, | |
{ | |
"key": "shift+g", | |
"command": "workbench.view.scm" |
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 | |
// .... | |
public function boot() | |
{ | |
Blade::directive('mix', function ($path) { | |
if(! app()->environment('production')) { | |
return "<?=e(mix({$path}))?>"; | |
} |
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 | |
class vbulletinValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
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
-1- edit ~/.composer/vendor/laravel/valet/cli/stubs/openssl.conf | |
Change: | |
basicConstraints = CA:FALSE | |
To: | |
basicConstraints = CA:TRUE,pathlen:0 | |
save file. |
OlderNewer