Skip to content

Instantly share code, notes, and snippets.

Lucas Paul L4grange

View GitHub Profile
@L4grange
L4grange / GPIO.java
Last active Sep 27, 2019 — forked from rosterloh/gpio.java
Android class for GPIO control
View GPIO.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
This class allows you to control GPIO pins form android, by abstracting the command line excecution into a java class.
IMPORTANT NOTE: Requires root to run, since it is required to write to GPIO ports in /sys/class/gpio/
*/
public class GPIO {
@L4grange
L4grange / FadeView.swift
Last active Jun 5, 2020
Fade a UIView in ios using Gradient (Swift Extension)
View FadeView.swift
///
/// With this extension you can call .fadeView(style: ) on any view to create a fading effect.
/// Very useful when trying to fade a UIScrollView, UITableView or UICollectionView
/// This way also takes care of the "white or black" transparent gradient that happens as described here: https://stackoverflow.com/questions/24882361/ios-white-to-transparent-gradient-layer-is-gray
/// This solution is a swift implementation of the following stackoverflow question in Swift, adding more styles: https://stackoverflow.com/questions/17774761/how-to-create-a-top-fade-effect-using-uiscrollview/25408833#25408833
///
extension UIView {
enum UIViewFadeStyle {
case bottom
You can’t perform that action at this time.