Skip to content

Instantly share code, notes, and snippets.

View juanjosezg's full-sized avatar
💻

Juan José Zermeño juanjosezg

💻
View GitHub Profile
@juanjosezg
juanjosezg / clean.sh
Created February 26, 2012 00:38
Remove eval(base64_decode injected code from php files
find . -name "*.php" | xargs sed -i 's/<*.*eval(base64_decode(".*"));*.*>//g' *.php
@juanjosezg
juanjosezg / rfc-empresa.js
Last active August 4, 2016 21:50
Valida RFC EMPRESA
function RfcEmpresa(rfcStr) {
var re = /^(([A-Za-z]){3})([0-9]{6})(([A-Z]|[a-z]|[0-9]){3})$/;
var str = rfcStr;
if(re.test(str) ==true){
return true;
}else{
return false;
}
@juanjosezg
juanjosezg / breakpoint.scss
Created September 30, 2016 20:40
BreakPoint
@mixin breakpoint($point){
@if ($point == lg){
@media (min-width: 1200px){ @content }
}
@else if ($point == md){
@media (min-width: 992px) and (max-width: 1199px){ @content }
}
@else if ($point == sm){
@juanjosezg
juanjosezg / breakpoint.sass
Created September 30, 2016 20:44
BreakPoint sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm
@juanjosezg
juanjosezg / gist:0c2feaaa5b4099d29ed6364aa26f3ddf
Created December 19, 2017 18:32
Minar desde consola Minergate
Instalacion de Minergate:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
Espeficicar E-mail moneda cores:
minergate-cli -user <usuario@email> -bcn 4
### Keybase proof
I hereby claim:
* I am juanjosezg on github.
* I am juanjosezg (https://keybase.io/juanjosezg) on keybase.
* I have a public key ASBib1CwRFgUl5PQDafdkTYsZoKTTG1wh1_TGzyn6TqkLwo
To claim this, I am signing this object:
function struuid($entropy)
{
$s=uniqid("",$entropy);
$num= hexdec(str_replace(".","",(string)$s));
$index = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
$base= strlen($index);
$out = '';
for($t = floor(log10($num) / log10($base)); $t >= 0; $t--) {
$a = floor($num / pow($base,$t));
@juanjosezg
juanjosezg / multipleEventsListeners.js
Created February 22, 2019 18:15 — forked from juanbrujo/multipleEventsListeners.js
Add the capability to attach multiple events to an element, just like jQuery does
/**
* multipleEventsListeners.js
* Add the capability to attach multiple events to an element, just like jQuery does
* https://gist.github.com/juanbrujo/a1f77db1e6f7cb17b42b
*/
function multipleEventsListeners(elem, events, func) {
var event = events.split(' ');
for (var i = 0; i < event.length; i++) {
elem.addEventListener(event[i], func, false);
@juanjosezg
juanjosezg / functions.php
Last active March 21, 2019 17:35
Hide Wordpress Notificarions
<?php
/* Hide Wordpress Notifications */
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates'); // For WordPress
add_filter('pre_site_transient_update_plugins','remove_core_updates'); // For all plugins
add_filter('pre_site_transient_update_themes','remove_core_updates'); // For all themes
@juanjosezg
juanjosezg / wordpress-perm.sh
Created November 8, 2019 16:50
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro (https://gist.github.com/macbleser/9136424)
#
WP_ROOT=${1:-.} # <-- wordpress root directory, current directory by default
[ -e "$WP_ROOT/wp-config.php" ] || { echo "Usage: $0 /path/to/wordpress"; exit; } # <-- detect that the directory is a wordpress root
WP_OWNER=$(id -u $(logname)) # <-- wordpress owner (This assumes the wordpress owner is the logged in user)