Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div id="mainContent">
<div area="Heading content" id="headingContent" editable="true">
<h2>This is step 6</h2>
<p>You can type a bunch of content here and it will only update on one page.</p>
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div id="mainContent">
<div id="mainNavigation" menu="Main Navigation">
<div repeat="10" active-class="main-highlight">
<p><a href="" characters="60">This is an item</a></p>
<html>
<head>
<title>My page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div id="mainContent">
<div area="Heading content" id="headingContent" editable="true">
<h2>You can use any formatting here, including images and embeds</h2>
<p>If you put in a bunch of content in here, then embed an image just like in the instructional video you'll see you can move it around.</p>
@iaindooley
iaindooley / xpath_escape.php
Created August 19, 2011 03:34
Function to escape single and double quotes in XPath queries using PHP
<?php
function xpathEscape($query,$default_delim = '"')
{
if((strpos($query,'\'') !== FALSE) ||
(strpos($query,'"') !== FALSE))
{
$quotechars = array('\'','"');
$parts = array();
$current_part = '';
@iaindooley
iaindooley / google_suggest.php
Created March 30, 2016 17:31
Google Suggest Scraper
<?php
if(count($_POST))
{
$name = microtime(true).'.txt';
$pid = pcntl_fork();
if($pid)
{
die('try here: <a href="out/'.$name.'">'.$name.'</a>');
}
<?php
/****
* This script presents an "algorithmic" way of doing a cohort analysis
* on your eCommerce customer database.
*
* This can be useful if you want to automate a lifetime value calculation
* based on some data available from a CSV file, database or API.
*
* The specifics of how your eCommerce system stores this information is
* abstracted out to a couple of objects with methods such as
@iaindooley
iaindooley / spaghetti_code.php
Created November 26, 2011 04:52
Spaghetti Code
<?php
function getPageTitle()
{
return mysql_result('SELECT title FROM data',0,'title');
}
?>
<html>
<head>
<title><?php echo htmlentities(getPageTitle()); ?></title>
</head>
@iaindooley
iaindooley / curl_request.class.php
Created April 26, 2011 04:43
A PHP class for making requests via cURL
<?php
class CurlRequest
{
private $curl;
private $url;
private $method;
private $get_fields;
private $post_fields;
private $sending_file;
const POST = 1;
@iaindooley
iaindooley / add_due_date_to_emails
Created October 26, 2018 00:51
Add Due date to Emailed Cards
function addDueDateToEmailedCard(notification)
{
new Notification(notification).addedCard("Emails in").setDue(Trellinator.now().addHours(24));
}
@iaindooley
iaindooley / move_and_rename_with_hashtag
Created November 8, 2018 00:18
move to list and rename card with hashtag
function moveAndRenameCardWithHashtag(notification)
{
var notif = new Notification(notification);
if(parts = /(.+) #(.+)/ig.exec(notif.createdCard("Inbox").name()))
notif.card().moveToList(notif.board().findOrCreateList(parts[2])).setName(parts[1]);
}