Skip to content

Instantly share code, notes, and snippets.

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

Javier Castro jadark

🏠
Working from home
View GitHub Profile
@jadark
jadark / woo-anadir-checkbox-checkout-admin-pedido.php
Created October 13, 2022 01:09 — forked from Oscar-Abad-Folgueira/woo-anadir-checkbox-checkout-admin-pedido.php
WooCommerce Snippet: Añadir campo checkbox al checkout y mostrar en el admin del pedido.
<?php
/**
* @snippet WooCommerce Snippet: Añadir campo checkbox al checkout y mostrar en el admin del pedido.
* @author Oscar Abad Folgueira
* @author_url https://www.oscarabadfolgueira.com
* @snippet_url https://www.oscarabadfolgueira.com/anadir-un-campo-de-checkbox-opcional-en-el-checkout-de-woocommerce-y-mostrar-en-el-admin-del-pedido
*/
// Añadir un campo checkbox al checkout y al anadir_estado_pedido_enviado_a_estados
add_action( 'woocommerce_review_order_before_submit', 'anadir_campo_checkbox_checkout' );
@jadark
jadark / fish_shell_android_home.txt
Created October 9, 2018 02:07 — forked from gbero/fish_shell_android_home.txt
Export $ANDROID_HOME on MacOS with Fish shell
First :
$ touch ~/.config/fish/config.fish; nano ~/.config/fish/config.fish
Copy this in the file :
set --export ANDROID $HOME/Library/Android;
set --export ANDROID_HOME $ANDROID/sdk;
set -gx PATH $ANDROID_HOME/tools $PATH;
set -gx PATH $ANDROID_HOME/tools/bin $PATH;
@jadark
jadark / 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,
@jadark
jadark / 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() {
@jadark
jadark / 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

@jadark
jadark / composer.sh
Last active April 23, 2018 23:36
Permisos Composer Global path
sudo chown -R $USER $HOME/.composer
@jadark
jadark / 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 */;
@jadark
jadark / 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
@jadark
jadark / 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;
@jadark
jadark / 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