Skip to content

Instantly share code, notes, and snippets.

@markcadag
markcadag / .swiftlint.yml
Created November 3, 2020 04:12
Thirty One Digital Lint Rules
disabled_rules: # rule identifiers to exclude from running
- trailing_whitespace
- force_try
- cyclomatic_complexity
line_length: 500
file_length: 1000
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- explicit_type_interface
@markcadag
markcadag / MXParallaxHeaderDelegateProxy.swift
Last active June 10, 2020 02:24
Migrate MXParallaxHeader Delegates to RxSwift observables
class MXParallaxHeaderDelegateProxy: DelegateProxy<MXParallaxHeader, MXParallaxHeaderDelegate>, DelegateProxyType, MXParallaxHeaderDelegate {
public weak private(set) var mxParallaxHeader: MXParallaxHeader?
public init(mxParallaxHeader: ParentObject) {
self.mxParallaxHeader = mxParallaxHeader
super.init(parentObject: mxParallaxHeader, delegateProxy: MXParallaxHeaderDelegateProxy.self)
}
static func registerKnownImplementations() {
@markcadag
markcadag / pre-commit-swiftlint.sh
Last active February 18, 2020 05:57 — forked from haruair/pre-commit-swiftlint.sh
Git Client-side pre-commit hook for SwiftLint
#!/bin/bash
#
# hook script for swiftlint. It will triggered when you make a commit.
#
# If you want to use, type commands in your console.
# $ ln -s ../../pre-commit-swiftlint.sh .git/hooks/pre-commit
# $ chmod +x .git/hooks/pre-commit
LINT=./Pods/SwiftLint/swiftlint
@markcadag
markcadag / ParallaxPageTransformer.java
Created September 2, 2018 12:13 — forked from Aracem/ParallaxPageTransformer.java
Parallax transformer for ViewPagers that let you set different parallax effects for each view in your Fragments.
package com.aracem.utils.animations.pagetransformation;
import org.jetbrains.annotations.NotNull;
import android.support.v4.view.ViewPager;
import android.view.View;
import java.util.ArrayList;
import java.util.List;
@markcadag
markcadag / gist:a88a11bb297537491f9b92a46be719d4
Last active March 6, 2019 14:29
Enable pause and play gif using glide 4.0
Glide.with(holder.itemView)
.asBitmap()
.load("http://i.imgur.com/VuItY0T.gif")
.into(holder.imageContent)
val playPauseGif = PlayPauseGif(holder.imageContent)
holder.imageContent.setOnClickListener{
if (playPauseGif.isPlaying()) {
Log.e(TAG, "pausing")