Skip to content

Instantly share code, notes, and snippets.


Fabio Nisci fabiosoft

View GitHub Profile
fabiosoft / FooterFix.m
Last active Jul 9, 2021
Create a UITableView Footer / Header With a Dynamic Height (using AutoLayout). All snippets must be implemented by a UIVIewController subclass
View FooterFix.m
[super viewDidLayoutSubviews];
if (!self.tableView.tableFooterView){
UIView *footerView = (UIView /*you can replace with you concrete type*/ *)self.tableView.tableFooterView;
CGFloat width = self.tableView.bounds.size.width;
CGSize size = [footerView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
if (footerView.frame.size.height != size.height) {
View AVPlayer_ViewController.swift
import AVFoundation
class ViewController {
private var videoPlayer: AVPlayer?
private var playerItem: AVPlayerItem?
private var layer: AVPlayerLayer?
func viewDidAppear(_ animated: Bool) {
fabiosoft / gist:e16cebdd4c8b072281c559a9f992063b
Created Aug 28, 2020 — forked from srosenthal/gist:3adc0dafcdd3c55656bad7a4a8de9c91
Batch convert HEIC (iPhone) photos to JPEG, preserving creation dates
View gist:e16cebdd4c8b072281c559a9f992063b
for i in *.heic; do sips -s format jpeg -s formatOptions best "${i}" --out "${i%heic}jpg" && touch -r "${i}" "${i%heic}jpg"; done
fabiosoft /
Last active Oct 30, 2019
Elegant ways to support equivalence ("equality") in Python classes
class Number:
def __init__(self, number):
self.number = number
def __eq__(self, other):
"""Overrides the default implementation"""
if isinstance(other, Number):
fabiosoft /
Created Oct 17, 2019
Array list diffing in python
# Python program to find the missing
# and additional elements
# source:
# examples of lists
list1 = [1, 2, 3, 4, 5, 6]
list2 = [4, 5, 6, 7, 8]
# prints the missing and additional elements in list2
print("Missing values in second list:", (set(list1).difference(list2)))
fabiosoft / go_left.xml
Created May 3, 2019
onvif cam wsdl command
View go_left.xml
<soap:Envelope xmlns:soap="" xmlns:wsdl="" xmlns:sch="">
<sch:PanTilt x="-1" y="0" space="0"/>
View resolve a conflict between tap gesture with table view didselected event.m
- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
if ([gestureRecognizer isEqual:self.tapRecognizer]) {
// for ios 7 , need to compare with UITableViewCellContentView
if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"] || [touch.view.superview isKindOfClass:[UITableViewCell class]]) {
return FALSE;
return TRUE;
View swiftlint.yml
disabled_rules: # rule identifiers to exclude from running
- line_length
- function_body_length
- cyclomatic_complexity
- multiple_closures_with_trailing_closure
- xctfail_message
# Swift 3 rules that do not make sense for Swift 2.3
- implicit_getter
fabiosoft / ZoomCardFlowLayout.swift
Created May 2, 2018 — forked from Oni-zerone/ZoomCardFlowLayout.swift
A card zooming custom flow layout
View ZoomCardFlowLayout.swift
// ZoomCardFlowLayout.swift
// Created by Oni_01 on 12/05/15.
// Copyright (c) 2015 Andrea Altea. All rights reserved.
import UIKit
fabiosoft /
Created Feb 27, 2018 — forked from fragolinux/
simple but effective node-red setup backup script
DATE=$(date +"%Y-%m-%dT%H-%M-%SZ")
# create dated backup folders
mkdir -p $WHERE/{sqlite,nodered,etc,homebridge}