title | emoji | description |
---|---|---|
art | 🎨 | Improving structure/format of the code. |
zap | ⚡️ | Improving performance. |
fire | 🔥 | Removing code or files. |
bug | 🐛 | Fixing a bug. |
ambulance | 🚑 | Critical hotfix. |
sparkles | ✨ | Introducing new features. |
memo | 📝 | Writing docs. |
rocket | 🚀 | Deploying stuff. |
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
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon --show | |
sudo cp /etc/fstab /etc/fstab.bak | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
sudo sysctl vm.swappiness=10 | |
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf | |
sudo sysctl vm.vfs_cache_pressure=50 |
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 | |
/** | |
* Allows a method in a class to be called either statically or instanced. | |
* | |
* To use, ensure custom method names are camelCase starting withthe word | |
* "either". For example, a method defined as "eitherGetResults()" | |
* can be called in either of the two following ways: | |
* | |
* $exampleObject->getResults() |
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 | |
if (! function_exists('safe')) { | |
/** | |
* Safely attempt to call methods and properties on something you believe | |
* to be an object but may be null, using a hidden anonymous class for | |
* syntactical sugar to keep your application logic looking simple | |
* and clean. | |
* | |
* @param object $value The suspected object. |
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 | |
define('PIPE_VALUE', '__pipe-' . uniqid()); | |
class Pipe implements ArrayAccess, Iterator, Serializable | |
{ | |
public $value; | |
private $position = 0; | |
public function __construct($value) |
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 | |
if (! function_exists('catch_exit')) { | |
/** | |
* Catch when a part of a script exits and execute a custom function at | |
* that point. Note that if exiting, the script does not continue. | |
* You can use this to, for example, flash a message and | |
* redirect the user instead of showing the default | |
* black text on white background "exit" view. | |
* |
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
/* | |
|-------------------------------------------------------------------------- | |
| Spacing | |
|-------------------------------------------------------------------------- | |
| | |
| Utilities for controlling an element's padding and margin. | |
| | |
*/ | |
$spacing-class: ( |
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
// Additional spin to the animation. | |
.hamburger { | |
display: inline-block; | |
width: 1.5em; | |
height: 1.5em; | |
padding-top: 0.3em; | |
padding-bottom: 0.3em; | |
vertical-align: middle; |
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
/* | |
|-------------------------------------------------------------------------- | |
| Spacing | |
|-------------------------------------------------------------------------- | |
| | |
| Utilities for controlling an element's padding and margin. | |
| | |
*/ | |
$spacing-class: ( |