Skip to content

Instantly share code, notes, and snippets.

View emmanuelbarturen's full-sized avatar
🌱
Give me an challenge

Emmanuel Barturen emmanuelbarturen

🌱
Give me an challenge
View GitHub Profile
@emmanuelbarturen
emmanuelbarturen / config-nginx-site.dev
Last active April 30, 2016 14:29
Pass uri and parameters in nginx
#in /etc/nginx/sites-available/sample.dev
#replace or add these lines
location / {
index index.php index.html;
try_files $uri $uri/ /index.php?url=$uri&$args;
}
@emmanuelbarturen
emmanuelbarturen / commands gulp on homestead
Last active October 20, 2019 04:15
Install browserSync on Homestead (vagrant)
$ npm cache clear (optional)
$ npm install --no-bin-links
$ npm install laravel-elixir --save-dev --no-bin-link
$ npm install laravel-elixir-livereload --save-dev --no-bin-links
#configurar gulpfile.js
$gulp watch
#for add font size or color
# subtitle shape:
#3
#00:02:31,570 --> 00:02:35,829
#Lorem ipsum dolor
#Find what
[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3} --> [0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3}\n
#Replace with
$0<font color="#FFFF00">
@emmanuelbarturen
emmanuelbarturen / CronJob For Laravel 5.*
Last active August 16, 2019 18:17
CronJob For laravel 5.* in Digital Ocean Droplet With Ubuntu
$crobtab -e
//copy ( * * * * * php /var/www/to/artisan schedule:run 1>> /dev/null 2>&1) to end of file
$sudo service cron restart
//check if cron is running , (see last 3 rows)
$sudo grep -i cron /var/log/syslog|tail -3
@emmanuelbarturen
emmanuelbarturen / instructions.txt
Created June 15, 2017 17:02
Install wordpress in homestead with composer
#in homestead
$ cd ~/Code
$ cd mkdir my-wordpress-project
$ cd my-wordpress-project
$ composer require johnpbloch/wordpress
# in homestead.yaml
sites:
- map: my-project.dev
to: /home/vagrant/Code/my-wordpress-project/wordpress
@emmanuelbarturen
emmanuelbarturen / main.js
Created July 21, 2017 15:31
simulate native maxlenth validation for mozilla
$('input[maxlength]').on('keyup',function(){
var max = $(this).attr('maxlength');
var currentLength = $(this).val().length;
return max <= currentLength;
});
@emmanuelbarturen
emmanuelbarturen / server
Last active January 30, 2018 16:11
Nginx Config for wordpress and laravel in the same server/hosting. How to put a wordpress in a laravel project. Wordpress folder, named blog, is inner public directory of laravel
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/laravel-project/public;
index index.php index.html index.htm;
server_name laravelProject.com www.laravelProject.com;
charset utf-8;
location /blog/index.php(/.*)?$ {
@emmanuelbarturen
emmanuelbarturen / upgrate Php7.0 to Php7.1
Last active May 2, 2018 16:55
Laravel requires upgrade Php7.0 to Php7.1
$sudo add-apt-repository ppa:ondrej/php
$sudo apt-get update
(optional) sudo apt-get remove php7.0
$sudo apt-get install php7.1
$sudo apt-get install php7.1-fpm
# config de extensiones php
$sudo apt-get install php7.1-xml
$sudo apt-get install php7.1-gd
$sudo apt-get install php7.1-mbstring
$sudo apt-get install php-curl
@emmanuelbarturen
emmanuelbarturen / artisan
Created September 16, 2017 16:02
Laravel 5.* Change output color in terminal.
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
@emmanuelbarturen
emmanuelbarturen / instructions.txt
Created October 3, 2017 19:42
Install wordpress on Homestead
# On homestead
$ cd Code
$composer create-project johnpbloch/wordpress project-name
# Set a local domain in host file
192.168.10.10 project-name.dev
# Update Hometead.yaml
sites:
- map: project-name.dev
to: /home/vagrant/Code/project-name/wordpress
# in terminal