View AVPlayer_ViewController.swift
import AVFoundation | |
class ViewController { | |
private var videoPlayer: AVPlayer? | |
private var playerItem: AVPlayerItem? | |
private var layer: AVPlayerLayer? | |
func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) |
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 |
View python_equalisty_hash.py
#source: https://stackoverflow.com/questions/390250/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): |
View list_diffing.py
# Python program to find the missing | |
# and additional elements | |
# source: https://www.geeksforgeeks.org/python-find-missing-additional-values-two-lists/ | |
# 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))) |
View go_left.xml
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsdl="http://www.onvif.org/ver20/ptz/wsdl" xmlns:sch="http://www.onvif.org/ver10/schema"> | |
<soap:Header/> | |
<soap:Body> | |
<wsdl:ContinuousMove> | |
<wsdl:Velocity> | |
<!--Optional:--> | |
<sch:PanTilt x="-1" y="0" space="0"/> | |
</wsdl:Velocity> | |
<!--Optional:--> | |
</wsdl:ContinuousMove> |
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 |
View ZoomCardFlowLayout.swift
// | |
// ZoomCardFlowLayout.swift | |
// | |
// | |
// Created by Oni_01 on 12/05/15. | |
// Copyright (c) 2015 Andrea Altea. All rights reserved. | |
// | |
import UIKit |
View backup.sh
#!/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} |
View Program.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static int[,] grid = new int[9, 9]; |
NewerOlder