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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Routing an unknown number of sub-levels | |
|-------------------------------------------------------------------------- | |
| | |
| This is how you can route an unknown number of sub-levels and pass them | |
| to the same controller. For example, the following URLs will go through | |
| the same route: | |
| |
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
/* | |
|-------------------------------------------------------------------------- | |
| At least one column must have a value | |
|-------------------------------------------------------------------------- | |
| | |
| This is a simple pair of triggers for MySQL databases that will disallow | |
| a row to be inserted into a table unless at least one of two predefined | |
| columns has a value set. | |
| | |
*/ |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel 5, Bootstrap 4 Pagination | |
|-------------------------------------------------------------------------- | |
| | |
| A partial view to handle pagination for collections in Laravel's query | |
| builder or Eloquent ORM, styled with Bootstrap 4. | |
| | |
| The pagination displays like the following, where * denotes the current |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel 5 - URL Query String Helper | |
|-------------------------------------------------------------------------- | |
| | |
| A helper function to take a URL string then quickly and easily add query | |
| string parameters to it, or change existing ones. | |
| | |
| url_queries(['order' => 'desc', 'page' => 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
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| PHP - Font Awesome Icon Helper | |
|-------------------------------------------------------------------------- | |
| | |
| A helper function to build the HTML for a Font Awesome icon with all of | |
| the recommended accessibility tags. | |
| | |
*/ |
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
<div id="unique-id" style="display:none;"> | |
<div class="popover-heading">This is a heading</div> | |
<div class="popover-body">This is HTML content that will be loaded inside a </div> | |
</div> | |
<span tabindex="0" role="button" data-toggle="popover" data-placement="bottom" data-popover-content="#unique-id"> | |
Click me to load a popover | |
</span> |
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
/* | |
|-------------------------------------------------------------------------- | |
| Bootstrap 4 - Close Popover When Losing Focus | |
|-------------------------------------------------------------------------- | |
| | |
| A JavaScript snippet that closes a Bootstrap 4 popover when clicking off | |
| of it, but unlike the default behaviour, allows it to stay open when | |
| clicking within the popover itself. | |
*/ |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel 5 - Route must start with @ | |
|-------------------------------------------------------------------------- | |
| | |
| A quick snippet showing use of the Route::where(); method that lets you | |
| define a regex pattern for the route to match, such as the "@" symbol | |
| at the beginning to denote a 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
## Misc. Commands ## | |
alias h='cd ~' | |
alias c='clear' | |
alias ls='ls -alh' | |
alias pubkey="/bin/cat ~/.ssh/id_rsa.pub | pbcopy" | |
## A quick way to get out of the current directory ## | |
alias ..='cd ../' | |
alias ...='cd ../../' | |
alias ....='cd ../../../' |
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
server { | |
server_name www.yourdomain.com; | |
return 301 $scheme://yourdomain.com$request_uri; | |
} |
OlderNewer