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/php | |
<?php | |
$usage = "Automated Wordpress installer\nby Ali Gangji\nUsage: wordpress install_dir -u dbuser -p dbpass -d dbname\nOptions:\n"; | |
$usage .= " -u dbuser Database username\n"; | |
$usage .= " -p dbpass Database password\n"; | |
$usage .= " -d dbname Database name\n"; | |
$usage .= " -h dbhost Database host\n"; | |
$usage .= " --private Hide blog from search engines\n"; | |
$usage .= " --prefix prefix Database prefix\n"; | |
if ($argc < 2) { |
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 | |
add_action( 'after_setup_theme', 'bootstrap_setup' ); | |
if ( ! function_exists( 'bootstrap_setup' ) ): | |
function bootstrap_setup(){ | |
add_action( 'init', 'register_menu' ); | |
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
$(document).ready(function(){ | |
var center = new L.LatLng(-18.9717, -3.53815); // geographical point (longitude and latitude) | |
var map = new L.Map('map', { | |
scrollWheelZoom: false, | |
}).setView(center, 3); | |
var watercolor = new L.StamenTileLayer("watercolor").addTo(map); | |
var overlayUrl = '/path/to/image.png', |
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
Description: | |
I wrote this so that I could evenly distribute elements in a line. Here's an example that may explain better than words: http://cl.ly/JHnp, http://jsfiddle.net/nathanielks/pvGcz/4/. What it does it take the parent element and scans it for specific child elements. It then calculates the various widths and adds a left margin accordingly. The reason each element is given a display: block and float:left is because of a weird bug with display: inline. The script requires the elements to displayed inline initially, but because inline elements have a few extra pixels around them, the elements aren't all contained, even though the math is right. Really weird. Anyway, here's how you use it. | |
Usage: | |
$('#parent').distributeElements(); | |
Here's the demo: http://jsfiddle.net/nathanielks/pvGcz/4/ |
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
/** | |
* Sale Products Up Front | |
*/ | |
add_action( 'woocommerce_product_query', 'cur_sale_products_up_front', 10, 2); | |
add_filter('posts_request', 'cur_modify_products_query', 10, 2); | |
add_filter('loop_start', 'cur_reorder_sale_items'); | |
//Utility function | |
function cur_replace_text($startPoint, $endPoint, $newText, $source) { |
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: WP Ultimate CSV Importer | |
*Plugin URI: http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html | |
*Description: A plugin that helps to import the data's from a CSV file. | |
*Version: 3.2.3 | |
*Author: smackcoders.com | |
*Author URI: http://www.smackcoders.com | |
* | |
* Copyright (C) 2013 Smackcoders (www.smackcoders.com) |
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 | |
/** | |
* Get the date for the day navigation link | |
* | |
* @param string $date_description | |
* @return string | |
* @since 3.1.1 | |
* @throws OverflowException | |
*/ | |
function tribe_get_the_day_link_date( $date_description ) { |
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 | |
abstract class Cur_Abstract { | |
public static $instance; | |
public static function get_instance() { | |
// Instead of doing is_object( static::$instance ), we check to see if | |
// static::$instance is an instance of static::$class. Because we're | |
// extending the class, static::$instance wants to be shared across any | |
// classes that extend Cur_Abstract, muddling up this check. If it were |
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
// Okie doke. Need to process how to handle reciprocal connections, as well | |
// as determining when to add a user to blog as a certain type. For | |
// example, lets talk about students adding family friends as students. | |
// A student will invite another student as a family friend. It'll check to | |
// see if that user exists, if so, record their user id and email an | |
// invitation to that user. The user will then accept the invitation. On | |
// invitation acceptance, when it goes to add the student to the journal | |
// hosts journal, it'll check to see if the current user ( journal guest ) | |
// is a student. If so, it'll also add the journal host to the journal | |
// guests' journal as well. |
OlderNewer