Skip to content

Instantly share code, notes, and snippets.

View dougbeal's full-sized avatar

Douglas Beal dougbeal

View GitHub Profile
@dougbeal
dougbeal / .emacs.el
Created April 26, 2013 23:01
Cross platform .emacs file to load configuration from repository
(require 'cl)
(defun load-init-file ()
(let* (
(user (getenv "USER"))
(repo "/git/home")
(locations
(list
(concat "/Users/" user repo)
(concat "/home/" user repo)
(concat "C:/cygwin/home/" user repo )
@dougbeal
dougbeal / extract_htmlurl_feedl.sh
Created October 23, 2014 21:47
Extract htmlUrl from feedly opml file using sed
#!/bin/sh
sed -n 's/.*htmlUrl="\([^"]*\)".*/\1/p' feedly.opml
@dougbeal
dougbeal / delete_unplayed.coffee
Created October 26, 2014 00:42
Delete unplayed episodes from feed page for overcast.fm
#developed/run from chrome CoffeeScript console
for cell in $('.usernewepisode')
cellid = cell.href.split('/').slice(-1)
delete_url = "https://overcast.fm/podcasts/delete_item/#{cellid}"
console.log delete_url
window.open delete_url, "_blank"
@dougbeal
dougbeal / find-duplicate-files.rb
Created January 2, 2016 22:17 — forked from ma11hew28/find-duplicate-files.rb
Ruby script that finds identical (md5) files in all subdirectories (recursive)
require 'digest/md5'
hash = {}
Dir.glob("**/*", File::FNM_DOTMATCH).each do |filename|
next if File.directory?(filename)
# puts 'Checking ' + filename
key = Digest::MD5.hexdigest(IO.read(filename)).to_sym
if hash.has_key? key
@dougbeal
dougbeal / Optional+Empty.swift
Created June 4, 2016 04:24 — forked from irace/Optional+Empty.swift
`UITextView` should really just have this by default.
protocol TextContaining {
var isEmpty: Bool { get }
}
extension String: TextContaining {
}
extension Optional where Wrapped: TextContaining {
var isEmpty: Bool {
switch self {

Keybase proof

I hereby claim:

  • I am dougbeal on github.
  • I am murderofcrows (https://keybase.io/murderofcrows) on keybase.
  • I have a public key ASBRT2_bdU4um4Lw_Qiud-fMwSMBsNpvJPSIcNhLfXm_eQo

To claim this, I am signing this object:

<?php
/*
Default Template
* The Goal of this Template is to be a general all-purpose model that will be replaced by customization in other templates
*/
$kind = get_post_kind_slug( get_the_ID() );
$meta = new Kind_Meta( get_the_ID() );
$author = Kind_View::get_hcard( $meta->get_author() );
$cite = $meta->get_cite();
function auto_approve_bridgy_comments($approved, $commentdata) {
return strpos($commentdata['comment_agent'], 'Bridgy (https://brid.gy/about) AppEngine-Google') !== false ? 1 : $approved;
}
add_filter('pre_comment_approved', 'auto_approve_bridgy_comments', '99', 2);
@dougbeal
dougbeal / Frankenstein.php
Created May 19, 2017 06:01 — forked from miklb/Frankenstein.php
facepiles for WP comments
/**
* Override core Walker_Comment for mf2 & Bulma.
*
* @method __construct
*/
class Independence_Walker_Comment extends Walker_Comment {
/**
* Start the element output.
*
* This opens the comment. Will check if the comment has children or is a stand-alone comment.
@dougbeal
dougbeal / post257.meta
Last active May 20, 2017 20:45
Meta data to debug mf2_syndication field being cleared
https://dougbeal.com/2017/05/19/257/
KeyValue
geo_latitude'47.2772'
geo_longitude'-122.284'
mf2_type'a:1:{i:0;s:7:"h-entry";}'
mf2_content'a:1:{i:0;s:47:"Lavender and Mushrooms - been a wet spring 🤣";}'
mf2_published'a:1:{i:0;s:25:"2017-05-19T20:54:39-07:00";}'
mf2_location'a:1:{i:0;s:20:"geo:47.2772,-122.284";}'
mf2_syndication'a:3:{i:0;s:66:"https://www.facebook.com/10106539500131218/posts/10106543472061438";i:1;s:40:"https://www.instagram.com/p/BUTMAt5FJmW/";i:2;s:53:"https://www.flickr.com/photos/gritmonkey/34648785321/";}'
mf2_place_name'a:1:{i:0;s:26:"Lakeland South, Washington";}'