This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
db_host="host"; | |
db_user="user"; | |
db_pass="password"; | |
db_name="database"; | |
domains=`mysql --silent --skip-column-names --host $db_host --user $db_user -p$db_pass $db_name --execute "SELECT domain FROM wp_blogs WHERE archived = '0' AND spam = '0' AND deleted = '0';"`; | |
for domain in $domains; do | |
the_date=`date`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: Answer to Stack Overflow's Question #7422487 | |
* Plugin URI: http://stackoverflow.com/questions/7422487/wordpress-urls-for-categories-and-years | |
* Description: :) | |
* Author: Federico Cingolani | |
* Version: 1.0.0 | |
* Author URI: http://twitter.com/fcingolani | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'mpris' | |
require 'cgi' | |
require 'launchy' | |
require 'gdata' | |
#obtenemos la metadata | |
md = MPRIS.new.player.metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<!-- really dirty! this is just a test drive ;) --> | |
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script> | |
<script type="text/javascript"> | |
function renderPDF(url, canvasContainer, options) { | |
var options = options || { scale: 1 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fc_count_posts_with_term($term_name, $taxonomy) | |
{ | |
global $wpdb; | |
$term = get_term_by( 'name', $term_name, $taxonomy ); | |
$st = $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts p | |
INNER JOIN $wpdb->term_relationships tr | |
ON (p.ID = tr.object_id) | |
INNER JOIN $wpdb->term_taxonomy tt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NOW=$(date +"%Y-%m-%d-%H%M") | |
DB_USER="" | |
DB_PASS="" | |
DB_NAME="" | |
DB_HOST="" | |
TREE_FILE="$NOW.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> | |
%html.no-js | |
<!--<![endif]--> | |
%head | |
%meta{ charset: "utf-8"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function import_csv_to_sqlite(&$pdo, $csv_path, $options = array()) | |
{ | |
extract($options); | |
if (($csv_handle = fopen($csv_path, "r")) === FALSE) | |
throw new Exception('Cannot open CSV file'); | |
if(!$delimiter) | |
$delimiter = ','; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL ^ E_NOTICE); | |
define( 'WXR_VERSION', '1.2' ); | |
/** | |
* Generates the WXR export file for download | |
* | |
* @since 2.1.0 | |
* |
OlderNewer