Skip to content

Instantly share code, notes, and snippets.

@nosyjoe
nosyjoe / SquareFrameLayout.kt
Created October 20, 2017 13:07
Square FrameLayout Kotlin implementation
/**
* A FrameLayout subclass that always has the same width and height and forms a square.
* The larger dimension will be set to the smaller to meet this invariant.
*/
class SquareFrameLayout: FrameLayout {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
@nosyjoe
nosyjoe / YoutubeController.swift
Created June 8, 2017 07:30
Youtube Controller for playing videos in a new screen
//
// Created by Philipp Engel on 26.04.17.
//
import Foundation
import UIKit
import youtube_ios_player_helper
class YoutubeController: UIViewController {
@nosyjoe
nosyjoe / RetryWithExponentialBackoff.swift
Created June 2, 2017 15:02
RxSwift Retry Operator With Exponential Back Off Extension
//
// Created by Philipp Engel on 02.06.17.
//
import Foundation
import RxSwift
extension ObservableType {
/**