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 | |
/** | |
* Created by PhpStorm. | |
* User: DhanPris | |
* Date: 15/05/2018 | |
* Time: 11:51 | |
*/ | |
namespace App\Http\Traits; |
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 { | |
listen 80; | |
root /home/projects/lara; | |
index index.html index.htm index.php; | |
server_name projects.loc; | |
location / { |
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
# Open terminal and paste this command | |
openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=localhost' -extensions EXT -config <( \ | |
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") | |
# Add this in you nginx config | |
server { | |
listen 443 ssl; |
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 | |
use Illuminate\Database\Seeder; | |
class CountrySeeder extends Seeder | |
{ | |
/** | |
* Run the database seeds. | |
* | |
* @return void |
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 | |
/** | |
* @author Ammar Faizi <[email protected]> | |
* @license MIT | |
* @link https://t.me/laravelindonesia/111952 | |
*/ | |
for ($i=0; $i<10; $i++) { | |
echo "Test ".$i."\n"; |
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
# Install SSL Certificate | |
openssl req -x509 -out imessage.loc.crt -keyout imessage.loc.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=imessage.loc' -extensions EXT -config <( \ | |
printf "[dn]\nCN=imessage.loc\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:imessage.loc\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") | |
# Copy paste this nginx configuration | |
map $http_upgrade $connection_upgrade { | |
default upgrade; |
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
# Install SSL Certificate | |
openssl req -x509 -out imessage.loc.crt -keyout imessage.loc.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=imessage.loc' -extensions EXT -config <( \ | |
printf "[dn]\nCN=imessage.loc\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:imessage.loc\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") | |
sudo a2enmod proxy && sudo a2enmod proxy_http && sudo service apache2 restart | |
# Copy paste this apache configuration | |
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
version: "2" | |
services: | |
web: | |
image: "docker-nginx-php7.1:latest" | |
container_name: web-lara | |
ports: | |
- "80:80" | |
- "443:443" | |
- "5300:5300" | |
privileged: true |
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
// Fix Image Orientation | |
func fixImageOrientation(image:UIImage) -> UIImage | |
{ | |
UIGraphicsBeginImageContext(image.size) | |
image.draw(at: .zero) | |
let newImage = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return newImage ?? image |
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
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh | |
POWERLEVEL9K_MODE='nerdfont-complete' | |
POWERLEVEL9K_PROMPT_ON_NEWLINE=true | |
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true | |
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true | |
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 | |
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_beginning" |
OlderNewer