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;
}
#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 / 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 / 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
@emmanuelbarturen
emmanuelbarturen / descripcion.txt
Created October 31, 2017 14:47
Social Auth de Google+
ir a https://console.developers.google.com/project/_/apiui/apis/library
crear credenciales > ID de Cliente OAUTH
Origines de JS autorizados = http://domain.com
URL de redireccionamiento autorizados = http://domain.com/g-callback
Copiar credenciales en .env de laravel
@emmanuelbarturen
emmanuelbarturen / ClassAttribute.php
Last active November 22, 2017 16:30
Create Accesors like laravel in object
class TheAttribute
{
public function __get($name)
{
$name = array_map('ucfirst', explode('_', $name));
$name = implode($name);
# use echo instead return if is not a framework
return $this->{'get' . $name . 'Attribute'}();
}
@emmanuelbarturen
emmanuelbarturen / Component.vue
Created December 19, 2017 22:32
event handler keypress vuejs
created: function () {
window.addEventListener('keyup', (event)=> {
if (event.keyCode === 27) {
this.showEditor = false;
}
});
},
@emmanuelbarturen
emmanuelbarturen / instructions.txt
Created December 24, 2017 13:38
wordpress permission recomended
chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--