Skip to content

Instantly share code, notes, and snippets.

View eduardobc88's full-sized avatar
:octocat:
Working from home

EDUARDO BELTRAN CARBAJAL eduardobc88

:octocat:
Working from home
View GitHub Profile
@eduardobc88
eduardobc88 / php_email_send.php
Last active December 15, 2015 19:59
PHP Send Email HTML Tables
function paghid_send_mail($to,$copy_to,$subject,$message_data) {
/** headers **/
$headers .= 'From: paghid<[email protected]>' . "\r\n";
if( $copy_to != "" ) {
$headers .= 'Bcc: '.$copy_to. "\r\n";
}
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$message_data = $message_data.'<p style="font-size: 12px; color: #444; text-align: right;">'.date_i18n('j F Y - H:i:s').'</p>';
@eduardobc88
eduardobc88 / share_social_button.html
Created February 15, 2016 17:34
Share HTML Button Telegram and WhatsApp
<a href="whatsapp://send?text=https://www.google.com.mx/" data-action="share/whatsapp/share" >Compartir en WhatsApp</a>
<br>
<a class="tgme_action_button" href="tg://msg_url?url=https://www.google.com.mx/">Compartir en Telegram</a>
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot reboot-bootloader
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
@eduardobc88
eduardobc88 / nginx-reverse-proxy.conf
Last active April 25, 2019 06:00
Nginx Reverse Proxy
#### start nginx config
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@eduardobc88
eduardobc88 / compile scss using nodejs
Created August 16, 2016 13:59
Compile scss with gulp or custom script using node-sass
/* =============== start gulp file =============== */
/* File: gulpfile.js */
// grab our packages
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var scss_directory = 'sass/';
@eduardobc88
eduardobc88 / docker-lamp-server.sh
Last active October 10, 2016 17:19
Docker - PHP, PHP(extensions), MySQL, PHPMYADMIN
# DOCKER start - LAMP Server
#docker run -p 80:80 -d -v /Users/eduardo/Development/nginx-wordpress/nginx-conf/:/etc/nginx/ --name e5o-nginx-wordpress nginx
# 1 - mysql user and password : root
docker run --name e5o-lamp-mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7
# 2 - phpmyadmin linked server
docker run --name e5o-lamp-phpmyadmin -d --link e5o-lamp-mysql:db -p 32779:80 phpmyadmin/phpmyadmin
# 3 - apache -- not linked
docker run --name e5o-lamp-apache --link e5o-lamp-mysql:db -p 80:80 -d -v /Users/eduardo/Development/LAMP/:/var/www/html php:5.6-apache /bin/bash -c 'a2enmod rewrite; apache2-foreground'
# php mysql driver extension
@eduardobc88
eduardobc88 / e5o-wp-theme-creator.sh
Created October 3, 2016 17:27
Shell Script to create basic WordPress theme
echo -n "\n\n============== E5O - WP Theme Generator ==============\n\n";
echo -n "Enter WP Theme Name: ";
read wp_theme_name;
echo -n "Enter WP Theme Author Name: ";
read wp_theme_author_name;
echo -n "Enter WP Author URL: ";
read wp_theme_author_url;
echo -n "Enter WP Theme URL: ";
read wp_theme_url;
echo -n "Enter WP Theme Description: ";
@eduardobc88
eduardobc88 / wp_mysql_queries.sql
Created November 16, 2016 23:02
MySQL queries for WordPress
# query to get all categories
SELECT tlax_term_taxonomy.term_id as category_id, tlax_term_taxonomy.count as category_count, tlax_terms.name as category_name FROM tlax_term_taxonomy,tlax_terms WHERE tlax_term_taxonomy.taxonomy = 'category' AND tlax_term_taxonomy.count > 0 AND tlax_terms.term_id = tlax_term_taxonomy.term_id GROUP BY tlax_terms.term_id ORDER BY tlax_terms.name ASC;
# query for get post from category ID and post ID
select
b.term_id as category_id,
c.ID as post_id,
c.post_title as post_title,
c.post_content as post_content,
@eduardobc88
eduardobc88 / android.sh
Created November 23, 2016 19:09
Android ADB Shell Commands
# Copy some file from android device system with adb. It will be hide
adb shell run-as com.g4a.quadratin cp /data/data/com.g4a.quadratin/databases/quadratin_app.db /sdcard/DB
@eduardobc88
eduardobc88 / express_remove_route.js
Created March 23, 2017 17:38
Express remove route
function express_remove_route(router_path,callback) {
express_stack = router.stack;
console.log("================= express_remove_route ==================");
express_stack.forEach(function(route_layer){
if( !route_layer ) return;
if( route_layer.route.path.indexOf(router_path) >= 1 ) {
//console.log(router_path,route_layer.route.path.indexOf(router_path)); // log layer
idx = express_stack.indexOf(route_layer);
//console.log("IDX",idx); // id to remove layer
express_stack.splice(idx, 1);