Skip to content

Instantly share code, notes, and snippets.

@wvega
wvega / mendeley-install.sh
Created February 9, 2011 23:20
Install Mendeley on Fedora
#!/bin/sh
ARCH=`uname -m`
INSTALL=/usr/local/mendeley
# As noted by Narendiran Anandan in http://disq.us/26v7yj,
# required OpenSSL libraries are availabe only at the following locations:
# http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/11/Fedora/x86_64/os/Packages/openssl-0.9.8k-1.fc11.x86_64.rpm
# http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/11/Fedora/i386/os/Packages/openssl-0.9.8k-1.fc11.i586|i686.rpm
case $ARCH in
@wvega
wvega / wp-plugin-template.php
Created July 28, 2011 03:15
A WordPress plugin template
<?php
/*
Plugin Name:
Plugin URI: http://wvega.com
Description:
Version: 1.0
Author: Willington Vega
Author URI: http://wvega.com
License: GPLv2
*/
@wvega
wvega / add-order-note-date-to-order-notes-column-in-csv-exports.php
Created May 2, 2020 01:15
Add order note date to order_notes column in CSV exports generated with WooCommerce Customers Orders Coupons Export
<?php // only copy this line if needed
/**
* Adds the order note date to the notes in the order notes column of CSV exports.
*/
/**
* Adds the order note date to the notes in the order notes column of CSV exports.
*
@wvega
wvega / wptranslationday.md
Created May 2, 2019 13:30
Descripción para el evento de traducción de WordPress

¡Reunámonos para traducir WordPress!

Haz parte de un evento global de 24 horas que incluirá un evento transmitido en línea y multiples meetups en diferentes ubicaciones en todas partes del mundo.

No es necesario tener experiencia haciendo traducciones para WordPress. La traducción se hacer generalmente a partir del texto que está disponible en Inglés (E.E.U.U).

En este evento:

  • Te ayudaremos a empezar a traducir plugins, temas y otros proyectos de WordPress.
  • Compartiremos trucos y consejos para realizar mejores traducciones.
@wvega
wvega / httpd-conf.py
Created June 24, 2010 19:38
Helper script to quickly setup Apache VirtualHosts on my laptop
#!/usr/bin/python
#
# helper script to quickly setup Apache VirtualHosts on my laptop
import os
import sys
HTTPD_CONF_DIR = '/var/www/conf.d'
HTTPD_DOCUMENT_ROOT = '/var/www/html'
@wvega
wvega / attendees.js
Last active February 10, 2019 16:35
Extract Meetup member information from event's Attendees page
Array.prototype.slice.apply(document.getElementsByClassName('member-item')).map((attendee) => {
return attendee.querySelector('a').href.replace('https://www.meetup.com/WordPressMedellin/members/', '').replace('/', '') + "," + attendee.querySelector('h4').innerText
}).join("\n")
@wvega
wvega / gist:5552259
Created May 10, 2013 03:46
A couple of functions to convert date and time format strings from jQuery UI Datepicker and jQuery TimePicker to PHP's date format.
<?php
$timepicker = array(
'h' => 'g',
'hh' => 'h',
'H' => 'G',
'HH' => 'H',
'mm' => 'i',
'ss' => 's',
'p' => 'A',
@wvega
wvega / wp-debug-util.php
Last active April 7, 2018 11:23
Utility functions for debugging WordPress websites
<?php
function wp_debug_util_get_hook_handlers( $hook_name ) {
global $wp_filter;
$hook_handlers = array();
foreach ( $wp_filter[ $hook_name ] as $priority => $handlers ) {
foreach ( $handlers as $handler ) {
if ( is_array( $handler['function'] ) && is_callable( $handler['function'] ) && is_object( $handler['function'][0] ) ) {
@wvega
wvega / minecraft-install.sh
Created December 4, 2010 18:14
Downloads and install Minecraft (http://minecraft.net) in Linux
#!/bin/sh
DESKTOP=/usr/share/applications/minecraft.desktop
INSTALL=/usr/local/minecraft
JAVA=/usr/java/latest/bin/java
MINECRAFT='http://www.minecraft.net/download/minecraft.jar'
mkdir $INSTALL
cd $INSTALL
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/load.php');
// ----------------------------------------------------