Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
background: #EEE;
}
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.timeago.js"></script>
<script type="text/javascript" src="js/timecleaner.js?v=2"></script>
<script type="text/javascript">
/*
@ivarvong
ivarvong / gist:701389
Created November 16, 2010 03:59
InCopy JavaScript POST
var myStory = app.documents.item(0).stories.item(0);
header = "POST /dev/postrecv.php HTTP/1.0 \
Host: ode.ivarvong.com \
From: [email protected] \
User-Agent: IVCopy/1.0 \
Content-Type: application/x-www-form-urlencoded \
Content-Length: ";
data = myStory.contents;
@ivarvong
ivarvong / gist:701391
Created November 16, 2010 04:01
Create WordPress draft post from XHR post
<?php
require( '../wp-load.php' );
$stringData = $_POST['data'];
// Create post object
$my_post = array();
$my_post['post_title'] = 'TITLE CHANGE ME';
$my_post['post_content'] = $stringData;
$my_post['post_status'] = 'draft';
<?php
/* use a regular expression to remove inline comments. in this case, everything gets removed if it's inside double at signs. @@so you could CQ this@@ */
function filter_remove_inline_comments($content) {
return preg_replace('/@@.*?@@/', '', $content);
}
add_filter('the_content', 'filter_remove_inline_comments', 5);
?>
<?php
/*
Plugin Name: ODE - Shortcode queries
Plugin URI: none
Description: Generates teases from shortcode queries. Enables shortcodes in widgets.
Author: Ivar Vong
Version: 0.2
Author URI: http://ivarvong.com
*/
@ivarvong
ivarvong / gist:942809
Created April 26, 2011 18:32
wordpress adgear template tags and shortcode.php
<?php
/*
Plugin Name: ODE - Ad tags
Plugin URI: http://no-page-yet
Description: Add template tags to return ads.
Version: 0.1
Author: Ivar Vong
Author URI: http://www.ivarvong.com/
License: GPL2
*/
@ivarvong
ivarvong / gist:945088
Created April 27, 2011 20:14
shortcode-query-110427.php
<?php
/*
Plugin Name: ODE - Shortcode queries
Plugin URI: none
Description: Generates teases from shortcode queries. Enables shortcodes in widgets.
Author: Ivar Vong
Version: 0.2
Author URI: http://ivarvong.com
*/
ODE BETA WordPress (DOESNT WORK)
HTTP/1.1 200 OK
Date: Sat, 30 Apr 2011 04:44:21 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1 PHP/4.3.10-22 mod_ssl/2.0.54 OpenSSL/0.9.7e
X-Powered-By: PHP/5.2.13
X-Pingback: http://beta.dailyemerald.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
@ivarvong
ivarvong / gist:950156
Created May 1, 2011 01:05
first try on the conversion script
omega-mm:convert mm1$ python CoPress-Convert.py
Welcome to the College Publisher database converter, from CoPress Inc. ( http://copress.org )
Please enter config filename (optional):
What format are your archives? 'cp4', 'cp5' or 'custom': cp5
What is your new website's URL: http://www.dailyemerald.com/
Do you want verbose results? (Y/n):
How should authors be associated with posts? ('custom field' or 'user'): custom field
Which custom field should authors be stored in?: cp_user
How should images be associated with posts? ('custom field' or 'insert'): custom field
Which custom field should images be stored in?: cp_image