This file contains hidden or 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 -x | |
# script by Stephanie Booth aka bunny http://stephanie-booth.com/ to install wordpress automatically (geeky, but useful for mass installs), with help from many people: drauh, io_error, zedrdave, roddie... and all those I've forgotten to mention. | |
# variables: $1 whatever, $2 wp_user, $3 wp_pass, $4 root password | |
# prerequisites: an existing mysql db, and a root password | |
# care! .htaccess is not generated, needs to be done manually, by clicking on "Update Permalinks" in Options once everything is installed | |
# todo: add themes, check plugin list, make wrapper script for multiple installs, prepare php patch template for options and common stuff, see if the script can edit the vhost conf files for mass installs, prepare alternate version for French, add bilingual plugin and maybe cache. Add an extra user to the WP install. Also an alternate version for upgrading the school blogs. |
This file contains hidden or 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 | |
// GoogleVoice(EMAIL, PASSWORD) | |
$gv = new GoogleVoice('[email protected]', 'password'); | |
// Sends an SMS. send_sms(NUMBER, MESSAGE) | |
echo $gv->send_sms('+15555555555', 'Example'); | |
// Gets all the sms | |
// get_sms() - returns all the sms | |
// get_sms(true) - returns all the unread sms | |
echo $gv->get_sms(); | |
This file contains hidden or 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
import re | |
import urllib2 | |
import urllib | |
import simplejson as json | |
# add my.ooma.com credentials here | |
username = '' | |
password = '' | |
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) |
This file contains hidden or 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 | |
/* | |
Copyright (c) 2009 Dimas Begunoff, http://www.farinspace.com/ | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, |
This file contains hidden or 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 | |
/* YouTube RSS */ | |
$query = 'select description from rss(5) where url="http://gdata.youtube.com/feeds/base/users/chrisheilmann/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile";'; | |
/* Flickr search by user id */ | |
$query .= 'select farm,id,owner,secret,server,title from flickr.photos.search where user_id="11414938@N00";'; | |
/* Delicious RSS */ | |
$query .= 'select title,link from rss where url="http://feeds.delicious.com/v2/rss/codepo8?count=10";'; |
This file contains hidden or 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 | |
$q = new WP_query(); | |
$q->query( 'post_type=site' ); | |
/* Begin the Loop */ | |
if ($q->have_posts()) : | |
while ($q->have_posts()) : $q->the_post(); | |
/** | |
* Now instantiate the Sites class we made in posttypes.php setting the $s variable |
This file contains hidden or 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 | |
// Create a post type class for site posts | |
// To use as a bookmarking post type for sites you want to save/share. | |
class TypeSites { | |
public $meta_fields = array( 'title', 'description', 'siteurl', 'category', 'post_tags' ); | |
public function TypeSites() { | |
$siteArgs = array( | |
'labels' => array( |
This file contains hidden or 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 | |
// hook into wordpress search function | |
add_filter( 'the_search_query', 'aggregated_search' );// Define what post types to search | |
function aggregated_search( $query ) { | |
if( $query->is_search ) { | |
$query->set( 'post_type', array( 'post', 'page', 'feed', 'attachment', 'movies', 'quotes' ));//define search types | |
} | |
return $query; | |
} |
This file contains hidden or 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 | |
// Initialize the Class and add the action | |
add_action('init', 'pTypesInit'); | |
function pTypesInit() { | |
global $sites; | |
$sites = new TypeSites(); | |
} | |
// Create a post type class for 'Site' posts | |
// To use as a bookmarking post type for sites you want to save/share. |
This file contains hidden or 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 | |
class SimplestWidget_Widget extends Strx_Widget { | |
function w_id(){ return 'simplest-widget'; } | |
function w_name(){ return 'My Simplest Widget'; } | |
/** Return the dashboard admin form */ | |
function w_form($instance){ | |
return '<p>'.$this->w_form_input($instance, 'title').'</p>'; | |
} |