Skip to content

Instantly share code, notes, and snippets.

jandro935

Block or report user

Report or block jandro935

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jandro935
jandro935 / Response.php
Created May 8, 2018 — forked from jeffochoa/Response.php
Laravel HTTP status code
View Response.php
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@jandro935
jandro935 / gist:b64f0477b197b1e1d536cfc4f170a279
Created Apr 9, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:b64f0477b197b1e1d536cfc4f170a279

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jandro935
jandro935 / xampp_php7_xdebug.md
Created Feb 23, 2018 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP
View xampp_php7_xdebug.md

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

@jandro935
jandro935 / main.php
Created Oct 5, 2015
Borrar tabla al desactivar plugin Wordpress
View main.php
function pluginUninstall() {
global $wpdb;
$table_name = $wpdb->prefix."adslzone_info";
// ¿Borrar otras opciones?
//delete_option('wp_yourplugin_version');
$wpdb->query("DROP TABLE IF EXISTS $table_name");
}
@jandro935
jandro935 / main.php
Last active Oct 5, 2015
Crear tabla con insert al activar Wordpress plugin
View main.php
function create_plugin_table() {
global $wpdb;
$table_name = $wpdb->prefix .'info';
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
$query_create = 'CREATE TABLE ' . $table_name . ' (
id mediumint(9) NOT NULL AUTO_INCREMENT,
@jandro935
jandro935 / admin.php
Created Sep 16, 2015
Comprobar si estamos en el primer/último elemento de un array PHP
View admin.php
foreach($miArray as $elem) {
if ($elem === end($miArray)) {
echo "ÚLTIMO ELEMENTO";
}
if ($elem === reset($miArray)) {
echo "PRIMER ELEMENTO";
}
@jandro935
jandro935 / functions.php
Created Aug 21, 2015
Wordpress enqueue styles and scripts examples (with Angular JS)
View functions.php
function styles_and_scripts() {
wp_enqueue_style( 'estilos', get_bloginfo('template_directory').'/library/css/main.css' );
wp_enqueue_script( 'navigation', get_bloginfo('template_directory').'/library/js/main.js', array(), '1.0', true );
wp_enqueue_script( 'jQuery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js', array(), '1.11.0', false );
// ENQUEUE ANGULAR JS
@jandro935
jandro935 / plugin.php
Created Jul 30, 2015
Basic Wordpress Post Type Creation
View plugin.php
function create_post_type_eventos() {
register_post_type( 'eventos',
array(
'labels' => array(
'name' => __( 'Eventos' ),
'singular_name' => __( 'Eventos' ),
'all_items' => __('Todos los eventos'),
),
'public' => true,
@jandro935
jandro935 / principal.php
Created Jul 7, 2015
Create Wordpress Widget with plugin
View principal.php
class Widget_Zona51 extends WP_Widget {
function Widget_Zona51() {
// Nombre, decsripción, etc. del widget
parent::WP_Widget(false, $name = 'Zona 51', $widget_options = array('description' => 'Acceso a la Zona 51'));
}
function widget($args, $instance) {
// Muestra el contenido del widget
echo 'Hola !';
@jandro935
jandro935 / u87.php
Created Jul 7, 2015
Wordpress Widget Base Code
View u87.php
// Widget Base Code
class My_Widget extends WP_Widget {
function My_Widget() {
// Nombre, decsripción, etc. del widget
parent::WP_Widget(false, $name = 'Nombre', $widget_options = array('description' => 'Descripción'));
}
function widget($args, $instance) {
// Muestra el contenido del widget
You can’t perform that action at this time.