Skip to content

Instantly share code, notes, and snippets.

View AmbroiseCollon's full-sized avatar

Ambroise Collon AmbroiseCollon

View GitHub Profile
@AmbroiseCollon
AmbroiseCollon / LiveQuerryArray.swift
Created July 9, 2016 16:09
Parse Live Query tableview
import Foundation
import Parse
import ParseLiveQuery
extension _ArrayType where Generator.Element == PFObject {
mutating func updateWithEvent(event: Event<PFObject>) {
switch event {
case .Created(let object):
append(object)
case .Entered(let object):
@AmbroiseCollon
AmbroiseCollon / uniqueId.js
Created July 7, 2016 08:19
Generate unique parse like ids
var max = 10000
var chars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0,
'A', 'Z', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'Q', 'S', 'D',
'F', 'G', 'H', 'J', 'K', 'L', 'M', 'W', 'X', 'C', 'V', 'B', 'N',
'a', 'z', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'q', 's', 'd',
'f', 'g', 'h', 'j', 'k', 'l', 'm', 'w', 'x', 'c', 'v', 'b', 'n']
var idArray = []
for (var i = 0; i < max; i++) {