Skip to content

Instantly share code, notes, and snippets.

View fabiosoft's full-sized avatar

Fabio Nisci fabiosoft

View GitHub Profile
@fabiosoft
fabiosoft / toggle_device_after_time.yaml
Last active September 22, 2022 22:11 — forked from derekoharrow/toggle_device_after_time.yaml
Home Assistant Blueprint to toggle a device after a period of time since state was set
blueprint:
name: Toggle device status after a period of time
description: "Once a device has been in a defined status for a period of time, toggle it's status"
domain: automation
input:
trigger_device:
name: Device
description: Which device to monitor and toggle?
selector:
entity:
@fabiosoft
fabiosoft / gist:e16cebdd4c8b072281c559a9f992063b
Created August 28, 2020 18:41 — forked from srosenthal/gist:3adc0dafcdd3c55656bad7a4a8de9c91
Batch convert HEIC (iPhone) photos to JPEG, preserving creation dates
for i in *.heic; do sips -s format jpeg -s formatOptions best "${i}" --out "${i%heic}jpg" && touch -r "${i}" "${i%heic}jpg"; done
- (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;
}
@fabiosoft
fabiosoft / ZoomCardFlowLayout.swift
Created May 2, 2018 19:49 — forked from Oni-zerone/ZoomCardFlowLayout.swift
A card zooming custom flow layout
//
// ZoomCardFlowLayout.swift
//
//
// Created by Oni_01 on 12/05/15.
// Copyright (c) 2015 Andrea Altea. All rights reserved.
//
import UIKit
@fabiosoft
fabiosoft / backup.sh
Created February 27, 2018 18:03 — forked from fragolinux/backup.sh
simple but effective node-red setup backup script
#!/bin/bash
DATE=$(date +"%Y-%m-%dT%H-%M-%SZ")
HOME=/home/pi
BACKUP=$HOME/backup
WHERE=$BACKUP/$DATE
# create dated backup folders
mkdir -p $WHERE/{sqlite,nodered,etc,homebridge}
@fabiosoft
fabiosoft / cleaner.sh
Last active December 12, 2016 21:52 — forked from wilson428/dropbox.sh
Fix Dropbox conflicts automatically.
#!/bin/bash
#Thx, http://stackoverflow.com/questions/20723868/batch-rename-dropbox-conflict-files
#Point to where you want the script to look and where it should backup files it replaces
folder="$(pwd)"
backup=~/Desktop/Dropbox.backup
#colors
red='\033[0;31m'