James Walker (a.k.a. walkah) is an independent developer and hacker. He is a long time Drupal developer, but these days spends more time in Python, Ruby and Javascript.
+
James Walker (a.k.a. walkah) is an independent developer and hacker. He is a long time Drupal developer, but these days spends more time in Python, Ruby and Javascript.
diff --git a/_layouts/default.html b/_layouts/default.html
index 8269178..60ddb3e 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -19,9 +19,9 @@
diff --git a/_plugins/gist_tag.rb b/_plugins/gist_tag.rb
deleted file mode 100644
index 74dd3b3..0000000
--- a/_plugins/gist_tag.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-# A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
-# by: Brandon Tilly
-# Source URL: https://gist.github.com/1027674
-# Post http://brandontilley.com/2011/01/31/gist-tag-for-jekyll.html
-#
-# Example usage: {% gist 1027674 gist_tag.rb %} //embeds a gist for this plugin
-
-require 'cgi'
-require 'digest/md5'
-require 'net/https'
-require 'uri'
-
-module Jekyll
- class GistTag < Liquid::Tag
- def initialize(tag_name, text, token)
- super
- @text = text
- @cache_disabled = false
- @cache_folder = File.expand_path "../.gist-cache", File.dirname(__FILE__)
- FileUtils.mkdir_p @cache_folder
- end
-
- def render(context)
- if parts = @text.match(/([\d]*) (.*)/)
- gist, file = parts[1].strip, parts[2].strip
- script_url = script_url_for gist, file
- code = get_cached_gist(gist, file) || get_gist_from_web(gist, file)
- html_output_for script_url, code
- else
- ""
- end
- end
-
- def html_output_for(script_url, code)
- code = CGI.escapeHTML code
- <<-HTML
-
-
- HTML
- end
-
- def script_url_for(gist_id, filename)
- "https://gist.github.com/#{gist_id}.js?file=#{filename}"
- end
-
- def get_gist_url_for(gist, file)
- "https://raw.github.com/gist/#{gist}/#{file}"
- end
-
- def cache(gist, file, data)
- cache_file = get_cache_file_for gist, file
- File.open(cache_file, "w") do |io|
- io.write data
- end
- end
-
- def get_cached_gist(gist, file)
- return nil if @cache_disabled
- cache_file = get_cache_file_for gist, file
- File.read cache_file if File.exist? cache_file
- end
-
- def get_cache_file_for(gist, file)
- bad_chars = /[^a-zA-Z0-9\-_.]/
- gist = gist.gsub bad_chars, ''
- file = file.gsub bad_chars, ''
- md5 = Digest::MD5.hexdigest "#{gist}-#{file}"
- File.join @cache_folder, "#{gist}-#{file}-#{md5}.cache"
- end
-
- def get_gist_from_web(gist, file)
- gist_url = get_gist_url_for gist, file
- raw_uri = URI.parse gist_url
- proxy = ENV['http_proxy']
- if proxy
- proxy_uri = URI.parse(proxy)
- https = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port).new raw_uri.host, raw_uri.port
- else
- https = Net::HTTP.new raw_uri.host, raw_uri.port
- end
- https.use_ssl = true
- https.verify_mode = OpenSSL::SSL::VERIFY_NONE
- request = Net::HTTP::Get.new raw_uri.request_uri
- data = https.request request
- data = data.body
- cache gist, file, data unless @cache_disabled
- data
- end
- end
-
- class GistTagNoCache < GistTag
- def initialize(tag_name, text, token)
- super
- @cache_disabled = true
- end
- end
-end
-
-Liquid::Template.register_tag('gist', Jekyll::GistTag)
-Liquid::Template.register_tag('gistnocache', Jekyll::GistTagNoCache)
diff --git a/_plugins/tag_index.rb b/_plugins/tag_index.rb
deleted file mode 100644
index fe247d7..0000000
--- a/_plugins/tag_index.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-module Jekyll
- class TagIndex < Page
- def initialize(site, base, dir, tag)
- @site = site
- @base = base
- @dir = dir
- @name = 'index.html'
- self.process(@name)
- self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
- self.data['tag'] = tag
- tag_title_prefix = site.config['tag_title_prefix'] || 'Posts Tagged “'
- tag_title_suffix = site.config['tag_title_suffix'] || '”'
- self.data['title'] = "#{tag_title_prefix}#{tag}#{tag_title_suffix}"
- end
- end
-
- class TagFeed < Page
- def initialize(site, base, tag_dir, tag)
- @site = site
- @base = base
- @dir = tag_dir
- @name = 'atom.xml'
- self.process(@name)
- # Read the YAML data from the layout page.
- self.read_yaml(File.join(base, '_layouts'), 'tag_feed.xml')
- self.data['tag'] = tag
- # Set the title for this page.
- tag_title_prefix = site.config['tag_title_prefix'] || 'Posts Tagged “'
- tag_title_suffix = site.config['tag_title_suffix'] || '”'
- self.data['title'] = "#{tag_title_prefix}#{tag}#{tag_title_suffix}"
- # Set the meta-description for this page.
-
- # Set the correct feed URL.
- self.data['feed_url'] = "#{tag_dir}/#{name}"
- end
- end
-
- class TagGenerator < Generator
- safe true
- def generate(site)
- if site.layouts.key? 'tag_index'
- dir = site.config['tag_dir'] || 'tag'
- site.tags.keys.each do |tag|
- dest_dir = File.join(dir, tag.gsub(/ /, '-'))
- write_tag_index(site, dest_dir, tag)
- write_tag_feed(site, dest_dir, tag)
- end
- end
- end
-
- def write_tag_index(site, dir, tag)
- index = TagIndex.new(site, site.source, dir, tag)
- index.render(site.layouts, site.site_payload)
- index.write(site.dest)
- site.pages << index
- end
-
- def write_tag_feed(site, dir, tag)
- feed = TagFeed.new(site, site.source, dir, tag)
- feed.render(site.layouts, site.site_payload)
- feed.write(site.dest)
- site.pages << feed
- end
-
- end
- # Adds some extra filters used during the category creation process.
- module Filters
-
- # Outputs a list of categories as comma-separated links. This is used
- # to output the category list for each post on a category page.
- #
- # +categories+ is the list of categories to format.
- #
- # Returns string
- #
- def tag_links(tags)
- tags = tags.sort!.map do |item|
- item.gsub!(/ /, '-')
- "#{item}"
- end
-
- case tags.length
- when 0
- ""
- when 1
- tags[0].to_s
- else
- "#{tags[0...-1].join(', ')}, #{tags[-1]}"
- end
- end
- end
-end
diff --git a/_posts/2004-06-17-meet-audrey.md b/_posts/2004-06-17-meet-audrey.md
index 15deffe..4eb8515 100644
--- a/_posts/2004-06-17-meet-audrey.md
+++ b/_posts/2004-06-17-meet-audrey.md
@@ -11,5 +11,3 @@ tags:
so, i've finally set mine up and gone through these instructions to get a root shell. let the hacking begin!
my first task, is that i wanted to use audrey as a digital photo frame - i.e. have it rotate through a bunch of my digital images (stored on my fileserver). after some digging (and disappointment that many projects seem to have disappeared), i came across this site. after some struggling with it (thanks for your help alex!) i managed to get it working the way i wanted. you can almost see the results in the attached photo.
-
-i'll continue to log any further hacks here.
diff --git a/_posts/2012-04-13-using-drush-to-mass-delete-comments.md b/_posts/2012-04-13-using-drush-to-mass-delete-comments.md
index faed92d..4c06024 100644
--- a/_posts/2012-04-13-using-drush-to-mass-delete-comments.md
+++ b/_posts/2012-04-13-using-drush-to-mass-delete-comments.md
@@ -5,20 +5,18 @@ tags:
- drupal
---
-Like many kind, good-natured geeks, I (yes, I was talking about me) host a number of small sites for friends. Many of those sites run Drupal and several don't get a lot of attention. That is, until spammers find their way around [Mollom](http://mollom.com/). I've seen this happen a few times, but most recently on a Drupal 7 site. In this particular case, the spam comments had been trickling in over a few weeks undetected. Following a burst of recent activity (enough to notice via monitoring), I checked in to find > 60,000 spam comments.
+Like many kind, good-natured geeks, I (yes, I was talking about me) host a number of small sites for friends. Many of those sites run Drupal and several don't get a lot of attention. That is, until spammers find their way around [Mollom](http://mollom.com/). I've seen this happen a few times, but most recently on a Drupal 7 site. In this particular case, the spam comments had been trickling in over a few weeks undetected. Following a burst of recent activity (enough to notice via monitoring), I checked in to find > 60,000 spam comments.
If this has ever happened to you: you're not alone. At this number of comments, using Drupal's interface (50 comments at a time) isn't really usable. Also, these things tend to happen in bursts - so chances are good there's a block of comments that are all spam (i.e. there haven't been any legitimate comments that you want to save since it started). So, I whipped up a small script here:
-{% gist 2379996 %}
+{% gist walkah/2379996 %}
Here's how to use it:
1. Place the code in a file (say, `comment-rm.php`) in your Drupal directory.
-2. Find the `cid` of the first spam comment (exercise left to the reader) and set `$first_comment` to that value.
+2. Find the `cid` of the first spam comment (exercise left to the reader) and set `$first_comment` to that value.
3. Run `drush scr comment-rm.php` and go grab a coffee.
Hope that helps someone, but at least now I can find it again next time.
*Beware*: This deletes comments forever, be careful.
-
-
diff --git a/_sass/_base.scss b/_sass/_base.scss
index 0e82f7f..46b8688 100644
--- a/_sass/_base.scss
+++ b/_sass/_base.scss
@@ -1,4 +1,4 @@
-@import "bourbon";
+@import "bourbon/bourbon";
@font-face {
font-family: Typewriter;
@@ -21,6 +21,6 @@ $gutter: 1em;
//$visual-grid: true;
-@import "neat";
+@import "neat/neat";
$mobile: new-breakpoint(max-width 500px 4);