Skip to content

Instantly share code, notes, and snippets.

View kenmhaggerty's full-sized avatar

Ken M. Haggerty kenmhaggerty

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kenmhaggerty on github.
  • I am kenmhaggerty (https://keybase.io/kenmhaggerty) on keybase.
  • I have a public key ASBTOJRUoFrdyI8p2I2R9KFubs2Q6rPdy0TNlllsDfAnYAo

To claim this, I am signing this object:

- (void)updateSection:(NSUInteger)section
withData:(nonnull NSArray *)data
insertionAnimation:(UITableViewRowAnimation)insertionAnimation
deletionAnimation:(UITableViewRowAnimation)deletionAnimation
getter:(nonnull NSArray * _Nonnull(^)(void))getter
setter:(nonnull void (^)(NSArray * _Nonnull data))setter
insertedCells:(nullable void (^)(NSArray <UITableViewCell *> * _Nonnull cells))insertionBlock
reorderedCells:(nullable void (^)(NSArray <UITableViewCell *> * _Nonnull cells))reorderingBlock
deletedCells:(nullable void (^)(NSArray <UITableViewCell *> * _Nonnull cells))deletionBlock
completion:(nullable void (^)(void))completionBlock;
{
"rules" : {
"$user_id" : {
".read" : "auth.uid == $user_id", // can read if $user_id matches current user
".write" : "auth.uid == $user_id", // can read if $user_id matches current user
".validate" : "newData.val().isString()" // new data must be string
}
}
}
{
"rules" : {
"objects" : {
"$object_id" : {
// OBJECT
".read" : "root.child('permissions/public/'+$object_id).val() == true || root.child('permissions/user/'+auth.uid+'/'+$object_id).val() == true", // can read if public or if permitted user
".write" : "root.child('permissions/user/'+auth.uid+'/'+$object_id).val() == true" // can write if permitted user or logged in and no existing object
}
},
"permissions" : {
{
root: {
"objects" : {
"$object_id" : {
...
// data goes here
}
},
"permissions" : {
"public" : {
{
root: {
"objects" : {
"$object_id" : {
"permissions" : {
"isPublic" : BOOL,
"users" : {
"$user_id" : BOOL
}
},
{
root: {
"objects" : {
"$object_id" : {
"permissions" : {
"isPublic" : BOOL,
"users" : {
"$user_id" : BOOL
}
},
- (void)updateFromArray:(nonnull NSArray *)array
toArray:(nonnull NSArray *)toArray
inSection:(NSUInteger)section
withInsertionAnimation:(UITableViewRowAnimation)insertionAnimation
deletionAnimation:(UITableViewRowAnimation)deletionAnimation
setter:(nonnull void (^)(NSArray * _Nonnull data))setterBlock
insertedCells:(nullable void (^)(NSArray <UITableViewCell *> * _Nonnull cells))insertionBlock
reorderedCells:(nullable void (^)(NSArray <UITableViewCell *> * _Nonnull cells))reorderingBlock
deletedCells:(nullable void (^)(NSArray <UITableViewCell *> * _Nonnull cells))deletionBlock
completion:(nullable void (^)(void))completionBlock
var sheetName = "Sheet1"; // name of your sheet
var firstRowOfData = 2; // first row of data
var firstColumnOfData = 2; // first column of data where A = 1
var lastColumnOfData = 3; // last column of data where A = 1
function onEdit(e) {
Logger.log("[METHOD] onEdit(e)");
if (e.source.getActiveSheet().getName() !== sheetName) {
return; // don't continue if a non-relevant sheet was edited
- (void)setName:(NSString *)name {
if ((!name && !_name) || [name isEqualToString:_name]) {
return;
}
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
if (name) {
userInfo[@"newValue"] = name;
}