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
on run {input, parameters} | |
set theProjectTitle to input as string | |
tell application id "com.devon-technologies.thinkpro2" | |
set theParentID to "66603FF9-03FE-4AE8-86AE-9621AA22FCA7" | |
set theGroup to get record with uuid theParentID | |
set theProjectGroup to create record with {name:theProjectTitle, type:group} in theGroup | |
set theProjectGroupID to the uuid of theProjectGroup | |
set theProjectGroupURL to "x-devonthink-item://" & theProjectGroupID |
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 | |
/* Iterator for arrays of WordPress posts or `WP_Query`. | |
* | |
* Simplifies "the loop" by automatically handling the `$post` global for each iteration | |
* (calling `the_post()`, `setup_postdata()` etc.) and makes sure to reset the global state when the loop has finished. | |
* | |
* Usage: | |
* Loop over ten last posts: | |
* <?php foreach (new WPQueryIterator(array('post_type' => 'post', 'posts_per_page' => 10)) as $i => $p): ?> | |
* <?php the_title(); ?> |
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
/* | |
* A simple JavaScript inheritance system | |
* (Like Prototype's `Class.create()`, only without the crazy method wrapping and function decompilation) | |
* | |
* Usage | |
* var A = Class.create({ | |
* // `initialize` is the constructor | |
* initialize : function(x, y) { | |
* this.x = x; | |
* this.y = y; |
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 | |
// the form... | |
class WikiWordForm extends Form { | |
private $word = NULL; | |
// declarative field configuration; this is where you define the form... | |
public function configure() { | |
$this->title = new TextField(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>HTML5 boilerplate with IE conditional comments magic</title> | |
</head> | |
<!--[if lt IE 7]> <body class="ie ie6"> <![endif]--> | |
<!--[if IE 7]> <body class="ie ie7"> <![endif]--> | |
<!--[if IE 8]> <body class="ie ie8"> <![endif]--> | |
<!--[if IE 9]> <body class="ie ie9"> <![endif]--> | |
<!--[if gt IE 9]> <body> <![endif]--> |
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 | |
/** | |
* Base-encoding/decoding with arbitrary radix. | |
* @see http://stackoverflow.com/questions/1119722/base-62-conversion-in-python#answer-1119769 | |
*/ | |
define('BASE_64_ALPHABET', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
function xbase_encode($number, $alphabet = BASE_64_ALPHABET) { | |
if ($number == 0) | |
return $alphabet[0]; |
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 | |
function normalize_flash_video_url($url) { | |
$url = trim($url); | |
if (preg_match('{(^http://www\.)?youtube\.com}', $url)) { | |
if (preg_match('{watch\?v=([^&]+)}', $url, $matches)) { | |
if (isset($matches[1])) | |
return "http://www.youtube.com/v/{$matches[1]}"; | |
} else if (preg_match('{/v/(\w+)}', $url, $matches)) | |
return "http://www.youtube.com/v/{$matches[1]}"; |