Skip to content

Instantly share code, notes, and snippets.

View earvinpiamonte's full-sized avatar

Noel Earvin Piamonte earvinpiamonte

  • Infor
  • Baguio City, Philippines
View GitHub Profile
@earvinpiamonte
earvinpiamonte / webpack.mix.js
Created October 26, 2020 05:19
Webpack setup with Tailwind CSS
const mix = require("laravel-mix");
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applications. By default, we are compiling the CSS
| file for the application as well as bundling up all the JS files.
@earvinpiamonte
earvinpiamonte / stripped.example.composer.json
Created September 9, 2020 15:25
Composer - use local repo as package
{
...
"repositories": [
{
"type": "path",
"url": "packages/vendor/package/",
"symlink": "true"
}
],
"license": "MIT",
@earvinpiamonte
earvinpiamonte / README.md
Created July 23, 2020 04:05
Adding project on `/var/www/html/`

Adding current logged in user to group www-data

sudo usermod -aG www-data $USER

Change owner of /var/www/html/project-name

sudo chown -R www-data:www-data /var/www/html/project-name/
@earvinpiamonte
earvinpiamonte / wp-config.php
Created July 23, 2020 03:51
WordPress wp-config.php without FTP
<?php
/** Sets up 'direct' method for wordpress, auto update without ftp */
define('FS_METHOD','direct');
@earvinpiamonte
earvinpiamonte / AppServiceProvider.php
Last active June 26, 2020 04:19
[Resolved] Laravel - "Specified key was too long error..." issue
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
@earvinpiamonte
earvinpiamonte / .bash_aliases
Last active October 23, 2020 06:09
My .bash_aliases for Linux
alias html='cd /var/www/html && clear'
alias downloads='cd ~/Downloads && clear'
alias c='clear'
alias ..="cd .."
alias ...="cd ../.."
alias speed='speedtest'
alias chrome="google-chrome $1"
@earvinpiamonte
earvinpiamonte / .htaccess
Created September 8, 2019 05:27
Laravel root .htaccess
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
@earvinpiamonte
earvinpiamonte / hosts
Created September 8, 2019 05:24
Eg. /etc/hosts
127.0.0.1 localhost
127.0.1.1 ASUS-X550LD
127.0.1.2 laravel-app
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
@earvinpiamonte
earvinpiamonte / eg-virtual-host-file.conf
Created September 8, 2019 05:23
Eg. virtual host file
<VirtualHost 127.0.1.2:80>
ServerName laravel-app
DocumentRoot /var/www/html/laravel-app
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/laravel-app>
Options All
AllowOverride All
@earvinpiamonte
earvinpiamonte / add_linux_user_to_www_data_group.bash
Last active September 2, 2019 14:39
Add Linux user to www-data group. Fix unable to edit files under /var/www/html/
# Add the current user to www-data group
sudo usermod -a -G www-data $USER
# Change the group of web server directory to www-data
sudo chgrp -R www-data /var/www/html
# Give write permission to the www-data group
sudo chmod -R g+w /var/www/html