Skip to content

Instantly share code, notes, and snippets.

View AKiniyalocts's full-sized avatar
🔭

Anthony Kiniyalocts AKiniyalocts

🔭
  • Big Nerd Ranch
  • Southgate, KY
View GitHub Profile
package br.com.nglauber.jetpackcomposeplayground.screens
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
@weverb2
weverb2 / TabLayoutExtensions.kt
Created March 30, 2020 16:04
Tab Selected Inline Functions
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
import com.google.android.material.tabs.TabLayout.Tab
inline fun TabLayout.doOnTabReselected(
crossinline action: (tab: Tab?) -> Unit
) = addOnTabSelectedListener(onTabReselected = action)
inline fun TabLayout.doOnTabUnselected(
crossinline action: (tab: Tab?) -> Unit
@nilsmehlhorn
nilsmehlhorn / index.js
Last active March 20, 2022 00:31
Firebase Cloud Function: Thumbnail Generator (Serverless)
const { join, dirname } = require('path')
const sharp = require('sharp')
const { Storage } = require('@google-cloud/storage')
const { promisify } = require('util')
const pump = promisify(require('pump'))
const gcs = new Storage()
const SIZE = 128
const PREFIX = 'thumb@'
@norsez
norsez / Date+ISO8601.swift
Created June 21, 2017 05:18
Swift 3: Date <-> ISO 8601 String conversion
extension Date {
static func ISOStringFromDate(date: Date) -> String {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS"
return dateFormatter.string(from: date).appending("Z")
}
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@NikolaDespotoski
NikolaDespotoski / RichBottomNavigationView.java
Last active February 13, 2023 23:51
Saving and restoring BottomNavigationView state
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BottomNavigationView;
@swankjesse
swankjesse / HostSelectionInterceptor.java
Last active May 17, 2024 19:11
This OkHttp application interceptor will replace the destination hostname in the request URL.
import java.io.IOException;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
/** An interceptor that allows runtime changes to the URL hostname. */
public final class HostSelectionInterceptor implements Interceptor {
private volatile String host;
extension UITextField {
func underlined(){
let border = CALayer()
let width = CGFloat(1.0)
border.borderColor = UIColor.lightGrayColor().CGColor
border.frame = CGRect(x: 0, y: self.frame.size.height - width, width: self.frame.size.width, height: self.frame.size.height)
border.borderWidth = width
self.layer.addSublayer(border)
self.layer.masksToBounds = true
@weverb2
weverb2 / ButterKnifeViewHolder.java
Created December 10, 2015 17:10
Adapted from https://gist.github.com/AKiniyalocts/d866274ddb55bfabc4f4 to bind a specific model to a view holder.
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import butterknife.ButterKnife;
/**
* Created by brandon on 12/9/15.
*/
public abstract class ButterKnifeViewHolder<T> extends RecyclerView.ViewHolder {
public ButterKnifeViewHolder(View itemView) {