Skip to content

Instantly share code, notes, and snippets.

@tomaspavlic
tomaspavlic / abput.sh
Last active June 23, 2020 08:30
Upload file or folder to Azure blob storage and shorten uploaded file with bit.ly.
#!/bin/bash
INPUT="$1"
CLEAN=$false
check_dependencies() {
for name in az curl sed tput; do
[[ $(which $name 2>/dev/null) ]] || {
echo -en "$name needs to be installed."
deps=1
@pkuecuekyan
pkuecuekyan / SearchContainerInTabBar.swift
Last active March 23, 2021 14:54
Set up a UISearchContainerViewController inside a UITabBar for tvOS 9
func setupTabBarWithSearchContainerView() {
// configure a UIViewController to display search results
// needs to conform to the UISearchResultsUpdating protocol
let searchResultsViewController = SearchResultsViewController()
// setup UISearchController and hook up to search results UIViewController
let searchController = UISearchController(searchResultsController: searchResultsViewController)
searchController.searchResultsUpdater = searchResultsViewController
searchController.hidesNavigationBarDuringPresentation = false