Skip to content

Instantly share code, notes, and snippets.

> grep Overcast /var/www/feeds.rebuild.fm/logs/access_log | awk '{print $9}' | sort | uniq -c
12022 200
> curl -I http://feeds.rebuild.fm/rebuildfm
HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Mon, 08 Dec 2014 19:05:14 GMT
Content-Type: application/rss+xml; charset=utf-8
Content-Length: 337859
Last-Modified: Sun, 07 Dec 2014 22:52:54 GMT
gem i json
Fetching: json-1.8.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/miyagawa/.rbenv/versions/2.2.0/bin/ruby -r ./siteconf20141225-12006-1tf9ofy.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
-- 1. TextEdit got an error: Can’t get POSIX file "..."
set p to "/path/to/file.txt"
tell application "TextEdit"
open file (POSIX file p)
end tell
-- 2. This works
tell application "TextEdit"
-- use literal
-- 1. TextEdit got an error: Can’t get POSIX file "..."
set p to "/path/to/file.txt"
tell application "TextEdit"
set q to POSIX file p
end tell
-- 2. This works
tell application "TextEdit"
set q to POSIX file "/path/to/file.txt"
on ScheduleCreated(programID)
set myid to programID as integer
tell application "EyeTV"
set show_name to (get the name of program id myid)
set start_time to (get the start time of program id myid)
do shell script "~/bin/pushme Schedule created: " & (quoted form of show_name) & " on " & (start_time as text)
end tell
end ScheduleCreated
➜ cat cpanfile
requires 'Catalyst';
➜ carmel install
Successfully installed Safe-Isa-1.000005
Successfully installed File-ShareDir-Install-0.10
Successfully installed CPAN-Meta-2.143240 (upgraded from 2.140640)
...
Successfully installed Catalyst-Runtime-5.90082
102 distributions installed
t/properties/release_status.t .. 1/? alpha->normal() is lossy at /Users/miyagawa/.cpanm/work/1421523409.95143/Module-Build-0.4210/blib/lib/Module/Build/Base.pm line 4581
alpha->normal() is lossy at /Users/miyagawa/.cpanm/work/1421523409.95143/Module-Build-0.4210/blib/lib/Module/Build/Base.pm line 4581
# Failed test 'dotted alpha version has release_status 'testing''
# at t/properties/release_status.t line 78.
# got: 'stable'
# expected: 'testing'
t/properties/release_status.t .. 13/? # Looks like you failed 1 test of 21.
t/properties/release_status.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/21 subtests
@miyagawa
miyagawa / pcast.pl
Created January 19, 2015 20:22
Post an audio link to Tumblr to generate a podcast with links (go to the URL /podcast on tumblr)
#!/usr/bin/env perl
use strict;
use Web::Query;
use WWW::Tumblr;
use YAML;
my $auth = YAML::LoadFile("$ENV{HOME}/.tumblr.yml"); # Grab them from API console
my $tumblr = WWW::Tumblr->new(%$auth);
my $link = shift @ARGV or die "Usage: pcast URL\n";
➜ Plack-Middleware-ConsoleLogger git:(master) travis enable
private method `load' called for Psych:Module
for a full error report, run travis report
➜ Plack-Middleware-ConsoleLogger git:(master) gem i travis
Successfully installed travis-1.7.5
Parsing documentation for travis-1.7.5
Done installing documentation for travis after 1 seconds
1 gem installed
➜ Plack-Middleware-ConsoleLogger git:(master) travis -v
private method `load' called for Psych:Module
An error occurred running `travis version`:
NoMethodError: private method `load' called for Psych:Module
from /Users/miyagawa/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/travis-1.7.5/lib/travis/cli/command.rb:373:i
n `load_config'
from /Users/miyagawa/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/travis-1.7.5/lib/travis/cli/command.rb:194:i
n `execute'
from /Users/miyagawa/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/travis-1.7.5/lib/travis/cli.rb:64:in `run'
from /Users/miyagawa/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/travis-1.7.5/bin/travis:18:in `<top (require
d)>'
from /Users/miyagawa/.rbenv/versions/2.2.0/bin/travis:23:in `load'