Skip to content

Instantly share code, notes, and snippets.

View ashfurrow's full-sized avatar

Ash Furrow ashfurrow

View GitHub Profile
require 'nokogiri'
require 'open-uri'
require 'cgi'
episodes = Array.new
doc = Nokogiri::HTML(open("http://www.notificationcenter.tv/feed.rss"))
episodes = doc.xpath("//item")
@ashfurrow
ashfurrow / Fresh macOS Setup.md
Last active May 3, 2024 01:51
All the stuff I do on a fresh macOS Installation

Apps to install from macOS App Store:

  • Pastebot
  • GIF Brewery
  • Slack
  • Keynote/Pages/Numbers
  • 1Password
  • OmniFocus 3
  • Airmail 3
  • iA Writer
@ashfurrow
ashfurrow / rails_console.rb
Created December 14, 2022 15:38
Script at the end of the m.t self-destruct
irb(main):026:1* def perform_total_query(domain)
irb(main):027:1* Follow.joins(:account).merge(Account.where(domain: domain)).count
irb(main):028:0> end
irb(main):026:0> inboxes = Account.inboxes
irb(main):026:0> zero_inboxes = inboxes.select {|i| perform_total_query(i.gsub("https://", '').gsub(
"http://", "").gsub("/inbox", "")) == 0} # lol whatever
irb(main):025:0> zero_inboxes.count
=> 12916
irb(main):026:0> inboxes.count
=> 14895
@ashfurrow
ashfurrow / mastodon.technology user stats.csv
Last active May 19, 2022 12:48
Historical user stats from mastodon.technology
Date Collected Logged in with 1 week Logged in with 2 weeks
May 31, 2017 262 322
Jul 2, 2017 303 442
Aug 5, 2017 227 321
Sep 2, 2017 208 289
Oct 3, 2017 231 285
Nov 1, 2017 212 433
Dec 5, 2017 242 302
Jan 7, 2018 316 400
Feb 4, 2018 262 314
# Remove old followers
account = Account.find(1) # that's me babey
scope = account.followers.eager_load(:account_stat).reorder(nil)
scope.merge! Account.by_recent_status
scope.merge! Account.local
scope.merge! AccountStat.where(last_status_at: nil).or(AccountStat.where(AccountStat.arel_table[:last_status_at].lt(6.months.ago)))
scope.count # 13146

Database looks fine. Ends with this:

{"log":"LOG:  could not send data to client: Broken pipe\n","stream":"stderr","time":"2020-04-01T21:09:16.86734608Z"}
{"log":"FATAL:  connection to client lost\n","stream":"stderr","time":"2020-04-01T21:09:16.867349505Z"}
{"log":"FATAL:  canceling authentication due to timeout\n","stream":"stderr","time":"2020-04-01T21:09:16.867352182Z"}
{"log":"FATAL:  canceling authentication due to timeout\n","stream":"stderr","time":"2020-04-01T21:09:16.867354895Z"}
{"log":"FATAL:  canceling authentication due to timeout\n","stream":"stderr","time":"2020-04-01T21:09:16.867357632Z"}
@ashfurrow
ashfurrow / gist:5976579
Last active February 29, 2020 06:15
Image Blurring – Accelerate vs. CoreImage

1.3MB png 640x1136

  • Accelerate 179ms every time
  • CoreImage 298ms first time 147ms subsequent times @1x scale
  • CoreImage 262ms first time 126ms subsequent times @0.5x scale
  • CoreImage 260ms first time 118ms subsequent times @0.25x scale

(Lower on 0.5x probably because of whole number for blur radius)

// Hope you had a nice day!