- PHP 5.6
- HHVM (Optional)
- Nginx
- MySQL
- Postgres
- Git 2+
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
function subStringBetweenTwo(a, b) { | |
const arr = a.split(''); | |
const brr = b.split(''); | |
return [...new Set(arr.filter(item => brr.includes(item)))] | |
} | |
subStringBetweenTwo('Hello', 'World') | |
// output: ['l', 'o'] | |
subStringBetweenTwo('Hi', 'World') |
First, you need to follow this blog tutorial for installing Nginx, PHP-FPM and MySQL to your computer (OSX Only).
Then, get the vhost.sh
file to your PC and make it executable:
chmod +x /path/to/vhost.sh
You may also move the vhost.sh
file to /usr/local/bin
path for global use.
sudo mv /path/to/vhost.sh /usr/local/bin/vhost
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/sh | |
# | |
## store the arguments given to the script | |
read oldrev newrev refname | |
# The deployed directory (the running site) | |
DEPLOYDIR=/root/web/domain.com | |
# Repository Directory | |
REPODIR=/root/repo/domain.git |
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
# Redirect to non-www | |
server { | |
server_name *.example.com; | |
return 301 $scheme://example.com$request_uri; | |
} | |
server { | |
# Document root | |
root /var/www/example.com; |
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 | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Barang extends Model { | |
protected $primaryKey = 'id_barang'; | |
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
# Add PPA(s) | |
sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder | |
sudo add-apt-repository ppa:mpstark/elementary-tweaks-daily | |
sudo add-apt-repository ppa:linrunner/tlp | |
sudo add-apt-repository ppa:hanipouspilot/focaltech-dkms | |
sudo apt-add-repository ppa:strukturag/libde265 | |
# Update | |
sudo apt-get update |
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('xls')) | |
{ | |
/** | |
* XLS Response. | |
* | |
* @param string $filename | |
* @param string $view | |
* @param array $data |
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
@servers(['web' => '[email protected]']) | |
@setup | |
$root = '~/public_html'; | |
$dir = $root . '/laravel'; | |
$branch = 'master'; | |
$artisan = $dir . '/artisan'; | |
$composer = '~/composer.phar'; | |
$repo = '[email protected]:username/repository.git'; | |
@endsetup |
NewerOlder