Skip to content

Instantly share code, notes, and snippets.

View xarbit's full-sized avatar

Jason Scurtu xarbit

View GitHub Profile
@Cosmo
Cosmo / m3u.swift
Last active August 21, 2023 09:59
Swift M3U Parser
struct MediaItem {
var duration: Int?
var title: String?
var urlString: String?
static func parseM3U(contentsOfFile: String) -> [MediaItem]? {
var mediaItems = [MediaItem]()
contentsOfFile.enumerateLines({ line, stop in
if line.hasPrefix("#EXTINF:") {
let infoLine = line.stringByReplacingOccurrencesOfString("#EXTINF:", withString: "")
require 'formula'
# Adapted from https://trac.macports.org/browser/trunk/dports/www/webkit-gtk
# Tested with newer glib and libsoup than currently in homebrew (also in tap).
class Webkitgtk < Formula
homepage 'http://webkitgtk.org/'
url 'http://webkitgtk.org/releases/webkitgtk-1.11.92.tar.xz'
sha1 'dbe9053eb8a9516cff6e796a4ba463bbb14fc464'
depends_on 'pkg-config' => :build