Skip to content

Instantly share code, notes, and snippets.

View SeanLintern's full-sized avatar

Sean Lintern SeanLintern

View GitHub Profile
@SeanLintern
SeanLintern / Pusher mass subscribe.swift
Last active July 16, 2019 10:09
Pusher mass subscribe
// Main subscription method
private func subscribeToRooms(withChats chats: Chats, completion: @escaping (_ conversations: ChatsWithSubscriber) -> Void) {
guard let user = chatUser else {return}
let activeCurrentUserChats = chats.filter { (aChat) -> Bool in
return user.rooms.contains(where: { (pcRoom) -> Bool in
if aChat is ProjectChat && pcRoom.lastMessageAt == nil {
return false
}
return aChat.room.roomID == pcRoom.id
//
// MovieRecorder.swift
// RosyWriter
//
// Translated by OOPer in cooperation with shlab.jp, on 2015/1/17.
//
//
//
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
//
// Capture.swift
// DemoVIdeoRecordingAndFirebase
//
// Created by Redditor :D on 02/04/2017.
//
import UIKit
import AVKit
import AVFoundation
@SeanLintern
SeanLintern / gist:3a78b3b40ee25561eb46f4e2044f5d26
Created April 28, 2017 14:17
AVCaptureAudioDataOutput Demo
import UIKit
import AVKit
import AVFoundation
import AssetsLibrary
func synchronized(_ object: AnyObject, block: () -> Void) {
objc_sync_enter(object)
block()
objc_sync_exit(object)
}