Skip to content

Instantly share code, notes, and snippets.

View javiercastrodev's full-sized avatar
🏠
Working from home

Javier Castro javiercastrodev

🏠
Working from home
View GitHub Profile
@javiercastrodev
javiercastrodev / gulpfile.js
Created October 24, 2017 23:25
gulp php + vuejs
'use strict';
var gulp = require('gulp'),
cache = require('gulp-cache'),
browserSync = require('browser-sync').create(),
reload = browserSync.reload,
changed = require('gulp-changed'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
plumber = require('gulp-plumber'),
@javiercastrodev
javiercastrodev / package.json
Created October 24, 2017 23:26
Config Vue PHP
{
"name": "AlvanItunes",
"version": "1.0.0",
"description": "Temlate SASSS PHP",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Javier",
@javiercastrodev
javiercastrodev / Laravel PHP7 LEMP AWS.md
Created November 21, 2017 20:15 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@javiercastrodev
javiercastrodev / nginx.conf
Created November 21, 2017 20:15 — forked from ashleydw/nginx.conf
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@javiercastrodev
javiercastrodev / SSL-Apache
Last active February 20, 2018 22:12
SSL APACHE | DigitalOcean
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
sudo certbot --apache -d chamnes.xyz
sudo certbot --apache -d chamnes.xyz -d www.chamnes.xyz
@javiercastrodev
javiercastrodev / ubigeos_peru.sql
Created March 16, 2018 15:39 — forked from cvega93/ubigeos_peru.sql
Perú, base de datos de Ciudades, Provincias y Distritos
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.7.17-0ubuntu0.16.04.2 - (Ubuntu)
-- SO del servidor: Linux
-- HeidiSQL Versión: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
@javiercastrodev
javiercastrodev / composer.sh
Last active April 23, 2018 23:36
Permisos Composer Global path
sudo chown -R $USER $HOME/.composer
@javiercastrodev
javiercastrodev / readme.md
Created August 3, 2018 23:26 — forked from hitautodestruct/readme.md
Generate a custom structure for Wordpress menus.

This gist is for showing an example of a custom wordpress menu.

If you want to get more from the menu item simply have a look at the $item object. i.e:

// Will return a large object with lots of props like title, url, description, id etc.
var_dump( $item );

This code works on Wordpress 4.1.1 as of 31st of March 2015

@javiercastrodev
javiercastrodev / sticky.js
Created September 19, 2018 20:59 — forked from javierarques/sticky.js
Sticky Sideabr With Vanilla Javascript. Detects scroll and set fixed the element. Live example: http://codepen.io/javiarques/pen/vKdgjR
// Sticky Nav Component
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {
@javiercastrodev
javiercastrodev / smooth-scroll.js
Created October 8, 2018 04:57 — forked from clemlatz/smooth-scroll.js
Simple smooth-scroll animation in pure/vanilla javascript
/**
* Smooth scroll animation
* @param {int} endX: destination x coordinate
* @param {int) endY: destination y coordinate
* @param {int} duration: animation duration in ms
*/
window.smoothScrollTo = function(endX, endY, duration) {
var startX = window.scrollX || window.pageXOffset,
startY = window.scrollY || window.pageYOffset,
distanceX = endX - startX,