Skip to content

Instantly share code, notes, and snippets.

View Richzendy's full-sized avatar
🎯
Focusing

Edwind Contreras Richzendy

🎯
Focusing
View GitHub Profile
@Richzendy
Richzendy / turpial.desktop.patch
Created December 29, 2013 19:33
Turpial desktop file patch
--- turpial-3.0-orig/turpial.desktop 2013-12-18 19:59:57.000000000 -0600
+++ turpial-3.0/turpial.desktop 2013-12-22 18:58:21.081595915 -0600
@@ -1,5 +1,5 @@
[Desktop Entry]
-Version=2.0
+Version=1.0
Name=Turpial
Name[es]=Turpial
GenericName=Microblogging client
@Richzendy
Richzendy / 0_reuse_code.js
Created June 6, 2014 19:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Richzendy
Richzendy / Add CSS class to children menu item on WordPress
Created August 27, 2014 23:59
Add CSS class to children menu item on WordPress
// Add CSS class to children menu item on WordPress
add_filter( 'wp_nav_menu_objects', 'add_menu_parent_class' );
function add_menu_parent_class( $items ) {
foreach ( $items as $item ) {
if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) {
$item->classes[] = 'menu-children-item';
}
}
@Richzendy
Richzendy / check-availability.php
Last active May 6, 2019 09:08
Script to check SoYouStart availability
<?php
/*
* Script to check SoYouStart availability based on http://www.tienle.com/2014/09-03/script-check-soyoustart-availability.html
* to help see http://www.richzendy.org/2014/10/05/script-php-para-chequear-y-notificar-disponibilidad-de-servidores-en-soyoustart.html
*/
define('CHECK_URL', 'http://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2');
define('NOTIFICATION_EMAILS', 'YOUR_EMAIL@DOMAIN.COM');
define('SYSTEM_EMAIL', '1'); // 1 = enabled local smtp system
define('MANDRILL', '0'); // 1 = enable email trought mandrill api, require an account on https://mandrillapp.com/
<div id="voting-form" style="display:none">
<?php echo do_shortcode( '[gravityform id="6" title="false" description="false" ajax="true"]' ) ?>
</div>
<a href="#voting-form" class="fancybox button">Vote Now</a>
// Remove menu from header area (on functions.php)
remove_action( 'genesis_after_header', 'genesis_do_nav' );
// Add New Menu (on functions.php)
register_nav_menu( 'after-header-menu' ,__( 'After Header Navigation Menu' ));
// Declare your new menu and clone styles from Main Menu (on wherever you want, functions.php function or template)
wp_nav_menu( array( 'theme_location' => 'after-header-menu','container' => 'nav', 'container_class' => 'nav-primary','items_wrap' => '<div class="wrap"><ul id="%1$s" class="genesis-nav-menu menu-primary %2$s">%3$s</ul></div>',) );
@Richzendy
Richzendy / Get_youtube_playlist_using_XML_RSS_with_dom.php
Last active August 29, 2015 14:25
Get youtube playlist using XML RSS with DOM PHP
<?php
/* Get youtube playlist using XML RSS with DOM PHP
* Based on http://bavotasan.com/2010/display-rss-feed-with-php/
*/
?>
<style>
.y-title h3 {
text-align: center;
font-size: 16px;
}
@Richzendy
Richzendy / Reglas_Principales_para_entrar_al_mundo_de_Wordpress.md
Last active February 28, 2020 13:11
Reglas Principales para entrar al mundo de Wordpress
  1. Empieza por leer (lo siento, está en inglés) el diccionario de terminología WordPress de la A-Z: https://premium.wpmudev.org/blog/wordpress-dictionary/
  2. Antes de codear algo en WP, busca un plugin o tema, hay miles de ellos, si no sabes cual usar, pregunta.
  3. Si vas a codear o modificar templates, aprende "Child Themes" y la jerarquia de ejecución https://developer.wordpress.org/themes/basics/template-hierarchy/
  4. Si vas a codear plugins o templates para WP, revisa la API, hay cientos de funciones ya hechas https://codex.wordpress.org/WordPress_APIs por ejemplo, ya WP tiene un sistema de manejo de llamadas AJAX built in ( https://codex.wordpress.org/AJAX_in_Plugins) y un ejemplo más didáctico del uso de AJAX dentro de WP lo puedes encontrar por acá https://premium.wpmudev.org/blog/using-ajax-with-wordpress/
  5. WP parece sencillo y en su estado puro no parece la gran cosa pero puede ser extendido fácilmente, aprende de "custom posts" y "custom fields" para personalizarlo ( advanced custom fields es un
@Richzendy
Richzendy / clearOS-do.sh
Created April 5, 2018 02:17
Script to install clearOS on Digital Ocean Droplet
#!/bin/bash
# bash script to install clearOS on a Digital Ocean Droplet
# taken from http://wikisuite.org/How-to-upgrade-a-fresh-install-of-CentOS-to-ClearOS
# Prep release and repos
rpm -Uvh http://download2.clearsdn.com/marketplace/cloud/7/noarch/clearos-release-7-current.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ClearOS-7
# Install and upgrade
yum --enablerepo=* clean all