Skip to content

Instantly share code, notes, and snippets.

View whjvenyl's full-sized avatar

whjvenyl whjvenyl

  • Bison Schweiz AG
  • Lucerne, Switzerland
View GitHub Profile

How to close CustomTab

When using CustomTab, it has no close method. To close CustomTab, should use Braodcast and call the activity which opened CustomTab again.

Good Example from Facebook SDK

I have fixed some of codes for essential behavior.

gradle setting

Add a library below.

dependencies {
@whjvenyl
whjvenyl / wake-up-light-alarm-with-sunrise-effect.yaml
Created December 18, 2020 23:04 — forked from sbyx/wake-up-light-alarm-with-sunrise-effect.yaml
Home Assistant Blueprint: Wake-up light alarm with sunrise effect
blueprint:
name: Wake-up light alarm with sunrise effect
description: A wake-up light alarm with a brightness and color temperature sunrise
effect using an existing timestamp sensor as source. Requires date_time_iso sensor
in configuration!
domain: automation
input:
light_entity:
name: Wake-up light entity
description: The light to control. Turning it off during the sunrise will keep
@whjvenyl
whjvenyl / what-forces-layout.md
Created September 22, 2020 07:29 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@whjvenyl
whjvenyl / Simple-browser-WKWebView-UIKit.md
Created May 22, 2020 11:48 — forked from quangDecember/Simple-browser-WKWebView-UIKit.md
Creating Simple Web Browser with WKWebView & UINavigationController

WKWebView was first introduced on iOS 8. With Apple finally release a deadline for all apps to migrate away from UIWebView, this series and this post is here to help you explore the features of WKWebView. In this blog post you will create a simple web browser with some basic features such as displaying content, back and forward.

Setup Previews for your project

One of the most interesting things coming out with Xcode 11 is SwiftUI's PreviewProvider, which provides a way to preview the UI during development instantly on multiple devices, multiple settings at the same time.

To preview UIViewController and UIView, you need to download previewing code from NSHipster

Since we are making this browser with a navigation bar, our main UIViewController needs to be embedded inside a UINavigationController. Therefore the previewing code would be like this:

@whjvenyl
whjvenyl / .env
Created August 11, 2019 16:50 — forked from mattlenz/.env
Kirby Nuxt
KIRBY_URL=http://localhost:8888
KIRBY_USERNAME=
KIRBY_PASSWORD=
@whjvenyl
whjvenyl / uninstall_citrix_receiver.sh
Created June 24, 2019 12:24 — forked from jweyrich/uninstall_citrix_receiver.sh
Citrix Receiver uninstaller for macOS
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
launchctl stop /Library/LaunchAgents/com.citrix.AuthManager_Mac.plist
launchctl stop /Library/LaunchAgents/com.citrix.ReceiverHelper.plist
launchctl stop /Library/LaunchAgents/com.citrix.ServiceRecords.plist
@whjvenyl
whjvenyl / snipsSuperTTS.sh
Created May 6, 2019 21:15 — forked from Psychokiller1888/snipsSuperTTS.sh
One TTS to rule them all
#!/usr/bin/env bash
# By Psycho
# Shell script to handle different TTS and online / offline connectivity
# This bash script can be set as a custom TTS for snips but also called directly from your skills
# a great way to give more than one personality to your assistant
# Original script: https://gist.github.com/Psychokiller1888/cf10af3220b5cd6d9c92c709c6af92c2
####### COMMON #######
#------------------------------------
@whjvenyl
whjvenyl / UIWindow+Extension.swift
Created April 11, 2019 16:25 — forked from ahbou/UIWindow+Extension.swift
Animate UIWindow rootViewController switch
extension UIWindow {
func setRootViewController(_ rootViewController: UIViewController?, animated: Bool) {
guard let viewContoller = rootViewController else {
self.rootViewController = rootViewController
return
}
var snapShotView: UIView?
@whjvenyl
whjvenyl / webpack.config.js
Created April 3, 2019 15:59 — forked from timurcatakli/webpack.config.js
An Easy to Understand Webpack 4+ Configuration File with Comments
const publicPath = 'public';
// Node os module
// The os module provides a number of operating system-related utility methods.
// It can be accessed using:
const os = require('os');
// Using a single monolithic configuration file impacts comprehension and
// removes any potential for reusability.
// As the needs of your project grow, you have to figure out the means to manage
// webpack configuration more effectively.
@whjvenyl
whjvenyl / adobe-cc-mac-uninstall.sh
Created March 23, 2019 17:23 — forked from rubenerd/adobe-cc-mac-uninstall.sh
Remove Adobe Creative Cloud from OS X
#!/bin/sh
rm -rf "/Applications/Adobe*"
rm -rf "~/Library/Application Support/Adobe/"
rm -rf "~/Library/Caches/Adobe*/"
sudo rm -rf "/Applications/Utilities/Adobe*"
sudo rm -rf "/Library/Application Support/Adobe/"
sudo rm -rf "/Users/Shared/Adobe/"