Skip to content

Instantly share code, notes, and snippets.

View antecoder's full-sized avatar
💭
coding, petting local cat

Joey Dalu antecoder

💭
coding, petting local cat
View GitHub Profile
@antecoder
antecoder / AutoSizeText.kt
Created December 18, 2024 14:40 — forked from inidamleader/AutoSizeText.kt
AutoSizeText: Composable function that automatically adjusts the text size to fit within given constraints with optimal performance by using a binary search algorithm
/*
MIT License
Copyright (c) 2024 Reda El Madini
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@antecoder
antecoder / Camera2VideoFragment.java
Created October 21, 2024 07:22 — forked from avrum/Camera2VideoFragment.java
Producing video chunks for Android using MediaRecorder
package com.example.android.mediarecorder;
/*
* Copyright 2014 The Android Open Source Project
*
* 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
@antecoder
antecoder / DyanmicTypeWithCustomFontExample.swift
Created September 23, 2024 14:48 — forked from surpher/DyanmicTypeWithCustomFontExample.swift
Dynamic Type with Custom Font automatically applied on a subclassed UILabel
// With info gathered at https://stackoverflow.com/a/42235227/789720
import UIKit
// MARK: - Use
// set label to be of class MJLabel programmatically or in storyboards
// set the label to be of preferred dynamic type Title 1|Title 2|...|body|...
// MARK: - "Global" settings
struct MJBranding {
static let fontFamily: String = "Party LET"
@antecoder
antecoder / coding challenge 11-03-2020.kt
Last active March 11, 2020 09:31
coding challenge 11-03-2020
import java.util.*
import kotlin.collections.HashMap
fun main() {
val letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
val lookupTable = HashMap<Int, String>()
for (index in letters.indices) {
lookupTable.put(index+1, letters[index].toString())
}