Skip to content

Instantly share code, notes, and snippets.

View mackuba's full-sized avatar
Playing with Bluesky API

Kuba Suder mackuba

Playing with Bluesky API
View GitHub Profile
mackuba / proper_way.rb
Created November 11, 2023 23:45
Bluesky login with federation
View proper_way.rb
# "proper" way, more future- and federation-proof
handle = form.get('handle')
password = form.get('password')
if dns_record = lookup_dns("_atproto.#{handle}")
did = did_from_dns(dns_record)
elsif res = open_url("https://#{handle}/.well-known/atproto-did")
did = did_from_well_known(res)
mackuba / bsky-hashtags.json
Last active September 8, 2023 15:33
Statistics of most popular hashtags on Bluesky in the last 30 days (2.6% of all posts include a hashtag)
View bsky-hashtags.json
"#art": 31687,
"#furryart": 21517,
"#furry": 20375,
"#nsfw": 12831,
"#1": 4572,
"#ListenToBlackVoices": 4341,
"#fursuit": 3950,
"#FogosPT": 3921,
"#ttrpg": 3378,
mackuba / bluesky_loader.rb
Last active July 3, 2023 23:01
Ruby script which loads posts from your Bluesky home feed and saves them to a local file
View bluesky_loader.rb
#!/usr/bin/env ruby
# Created by Kuba Suder on 25/04/2023
# Licensed under WTFPL License
require 'json'
require 'net/http'
require 'open-uri'
require 'set'
require 'time'
mackuba / Bluesky.swift
Created April 24, 2023 14:58
Basic Swift code to log in and send a post to Bluesky
View Bluesky.swift
// Bluesky.swift
// Created by Kuba Suder on 24/04/2023.
// Licensed under WTFPL License
import Foundation
struct LoginData: Encodable {
let identifier: String
mackuba / core_data_wwdc.json
Last active April 14, 2023 02:43
List of all WWDC talks about Core Data since 2010
View core_data_wwdc.json
"id": "wwdc2010-118",
"title": "Mastering Core Data",
"description": "Core Data contains a vast set of advanced features to help you better manage your data and evolve your application over time. Master the techniques for working with data in your application, from being more efficient to doing more in the database and changing how you store your data over time. Take your Core Data knowledge to the next level.",
"links": [
mackuba /
Last active March 29, 2022 15:23
How to create toolbar buttons in AppKit

Creating toolbar buttons

Recently I was writing a post about NSButton styles on my blog, and when I got to the part about toolbar buttons (Textured Rounded), I realized that I actually had no idea how to create a toolbar in AppKit, so I had to do some research first. I found some help in this sample project from Apple and this project on GitHub, and then I did some experiments with different combinations of things to see what works where.

This could probably be a whole separate blog post on its own (and maybe I'll make this into one), but for now I've put it here to not make that main article even longer.

Here's what I've found:

There are a few different kinds of buttons you can put in the toolbar:

mackuba / download_wwdc.rb
Last active September 12, 2021 13:52
Script for downloading all WWDC videos from a JSON feed
View download_wwdc.rb
#!/usr/bin/env ruby
# 06/2021:
# 11/2020:
# 5/2019:
# 8/2017:
# 5/2016:
require 'fileutils'
require 'json'
mackuba /
Created November 2, 2020 14:39
Script to hide cookier banner in Deezer's Electron app
set -e
set -x
cd /Applications/
mackuba / note_compiler.rb
Created June 6, 2020 00:55
Code for formatting hand-written plain text notes into formatted HTML
View note_compiler.rb
class NoteCompiler
def build(text, info)
note =, info)
class NoteContent
def initialize(text, info)
@text = text
@info = info
View wwdc_video_links.json