Skip to content

Instantly share code, notes, and snippets.

View phillipadsmith's full-sized avatar

Phillip Smith phillipadsmith

View GitHub Profile
UPDATE "grp"
SET "active" = 'FALSE'
WHERE "name" ~ '2nd test site'
@phillipadsmith
phillipadsmith / briccatsearch.user.js
Created April 24, 2009 23:42
Search-as-you-type interface for Bricolage categories.
// ==UserScript==
// @name Bricolage category search
// @namespace http://wiki.bricolage.cc/greasemonkey
// @description Search-as-you-type interface for Bricolage categories. Works for "New Story", "New Media", and "New Category" pages.
// @include */workflow/profile/*/new/*
// @include */admin/profile/category
// ==/UserScript==
// Create an object, used below
var CatSearch = {
@phillipadsmith
phillipadsmith / delete-all.user.js
Created April 24, 2009 23:41
Allows you to check all of the delete checkboxes in the Story Profile
// ==UserScript==
// @name Bricolage Delete All
// @namespace http://wiki.bricolage.cc/greasemonkey
// @description Allows you to check all of the delete checkboxes in the Story Profile
// @include *
// ==/UserScript==
(function () {
var spans = document.getElementsByTagName("span");
@phillipadsmith
phillipadsmith / gist:101402
Created April 24, 2009 23:39
autohandler.mc
<html>
<body>
% $burner->chain_next;
</body>
</html>
<%perl>;
foreach my $e ( $element->get_elements(qw(paragraph))) {
$m->print('<p>', $e->get_data, "</p>\n");
}
</%perl>
@phillipadsmith
phillipadsmith / gist:101378
Created April 24, 2009 22:19
rich_paragraph.mc
<% $paragraph %>
<%INIT>
my %embeds = ();
# Get paragraph with markup language
my $markup = $element->get_data('paragraph');
# Store embedded elements in a hash
foreach my $e ($element->get_elements) {
if ($e->has_name('embed_related_image')) {
@phillipadsmith
phillipadsmith / gist:101376
Created April 24, 2009 22:16
rich_paragraph.mc
<% $paragraph %>
<%INIT>
my %embeds = ();
# Get paragraph with markup language
my $markup = $element->get_data('paragraph');
# Store embedded elements in a hash
foreach my $e ($element->get_elements) {
if ($e->has_name('embed_related_image')) {
print "hello, world";