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
| SELECT * FROM node_revisions | |
| INNER JOIN node ON node.nid = node_revisions.nid | |
| WHERE body LIKE '%search term%' | |
| AND node.status = 1 | |
| AND node_revisions.vid IN (SELECT vid FROM node WHERE status = 1) |
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
| -- of all the characters, whose paragraphs/speeches are the longest, on average? | |
| SELECT | |
| "characters"."name" AS "character_name", | |
| SUM(length("paragraphs"."plain_text")) as "letter_count", | |
| COUNT(*) as "paragraph_count", | |
| SUM(length("paragraphs"."plain_text"))/COUNT(*) as "drone_factor" | |
| FROM "paragraphs" | |
| INNER JOIN "characters" ON "paragraphs"."character_id" = "characters"."id" |
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
| # ----------------------------------------------------------------------------------- | |
| # Create the database | |
| CREATE DATABASE `shkspr` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
| # ----------------------------------------------------------------------------------- | |
| # Create table structures | |
| CREATE TABLE `shkspr`.`Chapters` ( | |
| `WorkID` VARCHAR( 32 ) NOT NULL , |
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
| // clear the email address field when the user clicks into it | |
| function clickClear(e) { | |
| if (e.value == 'Your email address') { // text must match the default value attribute on the <input> tag | |
| e.value = ''; | |
| } | |
| } |
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
| // Adapted from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript | |
| // Give a querystring like this: yourpage.html?cheese=wensleydale&biscuits=nice | |
| var qs = (function(a) { | |
| if (a == "") return {}; | |
| var b = {}; | |
| for (var i = 0; i < a.length; ++i) | |
| { | |
| var p=a[i].split('='); | |
| if (p.length != 2) continue; |
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
| /* Use the Munchkin API to record a 'visitWebPage' event (see http://community.marketo.com/MarketoArticle?id=kA050000000Kyr7). Set the url of the visitWebPage event to the url of the download. I found that I had to make the link open in a new window, otherwise the Munchkin never manages to 'call home'... | |
| I did it with jQuery. Replace $jq with a reference to a valid jQuery object in the code below. | |
| We use a separate subdomain for Marketo-hosted landing pages and resources (in common with most users, I suspect). Since we wanted to track downloads for any PDF or PPT file within that domain, the jQuery selector pretty much wrote itself. It's case sensitive, but could easily be extended or modified to work around that - wasn't necessary for me. | |
| Opening the links in a new window seems to help with the tracking. If the new page loads too quickly, then it seemed as if the event handler code didn't get called. Leaving the original window open avoids this (I set target="_blank"). | |
| */ |
NewerOlder