gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
Source: https://medium.com/@Mahmoud_Zalt/eloquent-relationships-cheat-sheet-5155498c209
One to one ( 1-1 ) |
One to many ( 1-n ) |
Poly one to many ( 1x-n ) |
Many to many ( n-n ) |
Poly many to many ( nx-n ) |
|
---|---|---|---|---|---|
Number of models | 2 only | 2 only | 3 and above | 2 only | 3 and above |
Number of tables | 2 (1/model) | 2 (1/model) | 3+ (1/model) | 3 (1/model + pivot) | 4+ (1/model + pivot) |
Pivot table | - | - | - | required |
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
/// Contains the coordinates of a point in a 2D Cartesian coordinate system. | |
public struct Point: Hashable { | |
/// The x-coordinate of the point. | |
public var x: Double | |
/// The y-coordinate of the point. | |
public var y: Double | |
} | |
extension Array where Element == Point { | |
/// Returns only the unique points in the array. |
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
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
/* ====================================================================================== | |
//! -- On Demand Image Sizing -- | |
Experimental code for generating custom image sizes on demand. | |
http://wordpress.stackexchange.com/a/124790 | |
From the author... | |
"When an image is then requested in a particular size, | |
which is not yet generated, it will be created only that once." | |
====================================================================================== */ |
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
import React from 'react'; | |
import Router from 'next/router'; | |
const login = '/login?redirected=true'; // Define your login route address. | |
/** | |
* Check user authentication and authorization | |
* It depends on you and your auth service provider. | |
* @returns {{auth: null}} | |
*/ |
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
#!/bin/zsh | |
# Shell Script to create all relevant icons from an high resolution artwork | |
if [ "x$1" != "x" -a -f "$1" ] ; then | |
INPUT=$1 | |
else | |
INPUT="Artwork.png" | |
fi | |
if [ ! -f "$INPUT" ]; then |
NewerOlder