- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# Login via SSH with password (LOCAL SERVER) | |
> ssh brad@192.168.1.29 | |
# Create folder, file, install Apache (Just messing around) | |
mkdir test | |
cd test | |
touch hello.txt | |
sudo apt-get install apache2 | |
# Generate Keys |
.Site { | |
display: flex; | |
flex-direction: column; | |
height: 100vh; /* 1 */ | |
} | |
.Site-header, | |
.Site-footer { | |
flex-shrink: 0; /* 2 */ | |
} | |
.Site-content { |
<?php | |
namespace App\Traits; | |
/** | |
* Trait SecureUpdatable | |
* Allows to secure update without override the existing fields in a model | |
* This dependes on the $fillable and $guarded attributes too | |
* @package App\Traits | |
*/ | |
trait SecureUpdatable | |
{ |
* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.
Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.
Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.
That's the theory, let's get to the work.