Skip to content

Instantly share code, notes, and snippets.

Avatar
📃
Scrolling timelines endlessly

Kuba Suder mackuba

📃
Scrolling timelines endlessly
View GitHub Profile
@mackuba
mackuba / bluesky_loader.rb
Last active April 27, 2023 12:35
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 'yaml'
@mackuba
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
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": [
[
"HD",
"https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_118__mastering_core_data.mov"
],
@mackuba
mackuba / creating_toolbar_buttons.md
Last active March 29, 2022 15:23
How to create toolbar buttons in AppKit
View creating_toolbar_buttons.md

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
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: https://devimages-cdn.apple.com/wwdc-services/pb9e2d31/0CF104D6-F0B3-4AE8-B9F0-6F2D9F54A502/contents.json
# 11/2020: https://devimages-cdn.apple.com/wwdc-services/n233a99f/5D23F1E9-9551-4768-ACF3-E3920F9C572D/contents.json
# 5/2019: https://devimages-cdn.apple.com/wwdc-services/j06970e2/296E57DA-8CE8-4526-9A3E-F0D0E8BD6543/contents.json
# 8/2017: https://devimages-cdn.apple.com/wwdc-services/h8a19f8f/049CCC2F-0D8A-4F7D-BAB9-2D8F5BAA7030/contents.json
# 5/2016: http://devimages.apple.com.edgekey.net/wwdc-services/g7tk3guq/xhgbpyutb6wvn2xcrbcz/videos.json
require 'fileutils'
require 'json'
@mackuba
mackuba / fix_deezer.sh
Created November 2, 2020 14:39
Script to hide cookier banner in Deezer's Electron app
View fix_deezer.sh
#!/bin/bash
set -e
set -x
ARCHIVE="app.asar"
WORKDIR="deezer_unpacked"
TMPFILE="/tmp/deezerupdate.txt"
cd /Applications/Deezer.app/Contents/Resources/
@mackuba
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 = NoteContent.new(text, info)
note.compile_html
end
class NoteContent
def initialize(text, info)
@text = text
@info = info
View wwdc_video_links.json
@mackuba
mackuba / log-exclude-bots.rb
Last active September 29, 2020 17:40
Scripts for processing Nginx logs for Piwik
View log-exclude-bots.rb
#!/usr/bin/env ruby
require 'optparse'
require 'set'
$buffer = []
$current_day = nil
$validated = Set.new
$invert = false
@mackuba
mackuba / macbook-pro-2016.md
Created January 18, 2017 03:06
MacBook Pro 2016 - an iOS developer's review
View macbook-pro-2016.md

MacBook Pro 2016 - an iOS developer's review

Here are some thoughts about my new MacBook Pro that I've been using for the last few weeks (the Santa Claus from DHL brought it to me just before Christmas), hopefully this will help someone who's considering getting one.

Note: this is written from the perspective of a person who switched to the MBP from a 2015 13" MacBook Air (i7) and also has a 2012 21" iMac. Your experiences will obviously be different if you have e.g. a fairly recent 15" Retina MacBook Pro.

Specs

  • MacBook Pro 15", late 2016
  • Core i7 2.9 GHz (4 cores)