Skip to content

Instantly share code, notes, and snippets.

@losh11
losh11 / bitcoin-wif-litecoin-wif.py
Created April 17, 2020 19:19
Convert Bitcoin WIF to Litecoin WIF format
'''
Bitcoin WIF to Litecoin WIF converter
=== INFO ===
Idk
=== USAGE (example) ===
% python3 litecoinwif.py
@klein-artur
klein-artur / complementaryColor.swift
Last active May 29, 2022 21:10
get complementary color to UIColor in Swift
// get a complementary color to this color:
func getComplementaryForColor(color: UIColor) -> UIColor {
let ciColor = CIColor(color: color)
// get the current values and make the difference from white:
let compRed: CGFloat = 1.0 - ciColor.red
let compGreen: CGFloat = 1.0 - ciColor.green
let compBlue: CGFloat = 1.0 - ciColor.blue
@db0company
db0company / topMostViewController.swift
Created January 19, 2015 14:28
Get the top most viewController anywhere in the app (typically from the appDelegate). Get the current visible viewController.
extension UIViewController {
func topMostViewController() -> UIViewController {
if self.presentedViewController == nil {
return self
}
if let navigation = self.presentedViewController as? UINavigationController {
return navigation.visibleViewController.topMostViewController()
}
if let tab = self.presentedViewController as? UITabBarController {
if let selectedTab = tab.selectedViewController {