Skip to content

Instantly share code, notes, and snippets.

@hhutch
hhutch / pallet.snippets.clj
Created July 20, 2011 14:15
Pallet snippets that are useful
(defn nodes-in-group
"Build a list of nodes in a given security-group"
[security-group]
(filter #(= (% 0) security-group)
(map #(vector (pallet.compute/group-name %)
(pallet.compute/primary-ip %)
(pallet.compute/id %)
(pallet.compute.jclouds/node-locations %) )
(pallet.compute/nodes srvc))))
#!/usr/bin/env perl
# Continually query google scribe using the first result returned creating abstract collective sub-conscious poetry
use LWP::Simple;
use JSON;
sub get_scribble {
my ($query, $last_sel) = @_;
my $cnt = get("http://scribe.googlelabs.com/suggest?client=gs&hl=en&q=".URI->new($query)."&s=c&callback=gsjc2");
if ($cnt) {