Skip to content

Instantly share code, notes, and snippets.

View buntsem's full-sized avatar

Bunty Kumar buntsem

View GitHub Profile
@jeffmcfadden
jeffmcfadden / IPCameraView.swift
Created July 2, 2014 22:48
A UIView Subclass For Displaying An IPCamera Stream (MJPEG)
class IPCameraView: UIView, NSURLSessionDataDelegate {
var imageView:UIImageView
var url: NSURL
var endMarkerData: NSData
var receivedData: NSMutableData
var dataTask: NSURLSessionDataTask
init(frame: CGRect) {
@katowulf
katowulf / gist:4741111
Last active April 11, 2024 12:07
Firebase security rules for a simple chat room model
{
"chat": {
// the list of chats may not be listed (no .read permissions here)
// a chat conversation
"$key": {
// if the chat hasn't been created yet, we allow read so there is a way
// to check this and create it; if it already exists, then authenticated
// user (specified by auth.id) must be in $key/users