ssh-keygen -t rsa -C "[email protected]" -b 4096 -f ~/.ssh/id_rsa_github
ssh-keygen -t rsa -C "[email protected]" -b 4096 -f ~/.ssh/id_rsa_gitlab
This file contains hidden or 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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// ... | |
for (NSString* family in [UIFont familyNames]) | |
{ | |
NSLog(@"%@", family); | |
for (NSString* name in [UIFont fontNamesForFamilyName: family]) | |
{ | |
NSLog(@" %@", name); |
This file contains hidden or 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 hidden or 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 |
This file contains hidden or 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 | |
namespace App\Lib; | |
use Utils; | |
class BulmaWalker extends \Walker_Nav_Menu | |
{ | |
private $cpt; // CPT, is current post a custom post type | |
private $archive; // Stores the archive page for current URL | |
public function __construct() |
This file contains hidden or 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. |
This file contains hidden or 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
/** | |
* when cf7 ajax-loader | |
* @param {[type]} form [description] | |
* @return {[type]} [description] | |
*/ | |
wpcf7.submit = function( form ) { | |
if ( typeof window.FormData !== 'function' ) { | |
return; | |
} |
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 hidden or 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
#Força a utilizar Cache-Control e Expires header | |
<IfModule mod_headers.c> | |
Header unset ETag | |
</IfModule> | |
FileETag None | |
<IfModule mod_expires.c> | |
ExpiresActive on | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType text/cache-manifest "access plus 0 seconds" | |
# Html |
This file contains hidden or 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 gulp from 'gulp'; | |
import browserify from 'browserify'; | |
import source from 'vinyl-source-stream'; | |
import buffer from 'vinyl-buffer'; | |
import eslint from 'gulp-eslint'; | |
import exorcist from 'exorcist'; | |
import browserSync from 'browser-sync'; | |
import watchify from 'watchify'; | |
import babelify from 'babelify'; | |
import uglify from 'gulp-uglify'; |
NewerOlder