Skip to content

Instantly share code, notes, and snippets.

View stoqn4opm's full-sized avatar

Stoyan Stoyanov stoqn4opm

  • HedgehogLab
  • United Kingdom
View GitHub Profile
@stoqn4opm
stoqn4opm / Chromecast MediaList
Last active January 30, 2023 09:07
media list for the test chromecast app
{
"categories": [
{
"name": "Movies",
"hls-old": "https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/hls/",
"dash-old": "https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/dash/",
"mp4": "",
"images": "https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/images/",
"tracks": "https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/tracks/",
"videos": [
@stoqn4opm
stoqn4opm / SharedOffsetCollectionView.swift
Created May 21, 2020 05:57
`UICollectionView` subclass that makes all its instances have the same scroll offset. When one instance scrolls all others will follow to the same content offset.
import UIKit
// MARK: - Notifications
extension Notification.Name {
/// Posted everytime when a `SharedOffsetCollectionView` scrolls. The object is the instances that got scrolled.
fileprivate static let didScroll = Notification.Name(rawValue: "SharedContentOffset.didScroll")
@stoqn4opm
stoqn4opm / JazzyDocsGen.sh
Last active November 3, 2018 15:41
A simple script that generates html documentation for XCode projects with the help of 'jazzy' (https://github.com/realm/jazzy) and opens it in browser.
#!/bin/bash
# A simple script that generates html documentation with the help of 'jazzy' (https://github.com/realm/jazzy) and opens it in browser.
###########################################
# Best way to use it:
# 1. Inside your project folder, create folder called 'Scripts'
# 2. Put this file 'JazzyDocsGen.sh' inside it.
# 3. In XCode, go to your project settings where targets are listed, and tap the '+' button to add new target.
# 4. Select the template Cross-platform > Other > Aggregate.
@stoqn4opm
stoqn4opm / ButtonNode
Created November 27, 2017 15:36
Implementetation of button for Apple's SpriteKit framework
//
// ButtonNode.swift
// Created by Stoyan Stoyanov on 27.11.17.
import SpriteKit
//MARK: - Action Types
extension ButtonNode {
@stoqn4opm
stoqn4opm / SKMultilineLabel.swift
Last active August 17, 2017 17:56 — forked from craiggrummitt/SKMultilineLabel.swift
Multi line label in Sprite Kit in Swift
//
// SKMultilineLabel.swift
//
// Created by Craig on 10/04/2015.
// Copyright (c) 2015 Interactive Coconut.
// MIT License, http://www.opensource.org/licenses/mit-license.php
//
/* USE:
(most component parameters have defaults)
let multiLabel = SKMultilineLabel(text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", labelWidth: 250, pos: CGPoint(x: size.width / 2, y: size.height / 2))