Skip to content

Instantly share code, notes, and snippets.

View Skaldebane's full-sized avatar
💻
Coding thingys...

Houssam Elbadissi Skaldebane

💻
Coding thingys...
View GitHub Profile
@reduz
reduz / godot_over_time1.md
Last active May 19, 2024 02:44
Godot source code in 2002

This is a walkthrough to the Godot codebase over time. I can't publish full repositories, but I will put here the interfaces of some APIs including the year they were created and how they looked like at the time.

2002, Larvotor

This was the first version of the engine as such. It was later on used to create Regnum Oline. This is source code where I am sure I can still put legally here. Here are some class interfaces.

Mesh class:

@maulikhirani
maulikhirani / BoxShadow.kt
Created July 15, 2023 13:25
Helper extension to use drop shadow in Jetpack Compose
import android.graphics.BlurMaskFilter
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import androidx.compose.runtime.Stable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Canvas
import androidx.compose.ui.graphics.ClipOp
import android.graphics.Matrix
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
@okmanideep
okmanideep / EventQueue.kt
Last active January 5, 2023 15:27
Event abstraction for Jetpack Compose
import androidx.compose.runtime.*
import kotlinx.coroutines.CoroutineScope
@Stable
internal class Event<T>(val value: T)
class MutableEventQueue<T>
internal constructor(): EventQueue<T>() {
private val events = mutableListOf<Event<T>>()
private val nextEventAsState = mutableStateOf<Event<T>?>(null)
/*
* Copyright 2020 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@unaisulhadi
unaisulhadi / SquareRadioButton.kt
Created April 2, 2022 14:20
Square Radio Button in Jetpack Compose
package com.hadi.themoment.ui.components
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.foundation.layout.wrapContentSize
// This example adds handling stylus input to the Custom Drawing example
// from the GTK4 Getting Started.
// See: https://docs.gtk.org/gtk4/getting_started.html#custom-drawing
#include <gtk/gtk.h>
/* Surface to store current scribbles */
@c5inco
c5inco / CollapsingTabBar.kt
Last active May 28, 2024 11:14
Jetpack Compose implementation of inspirational design https://twitter.com/philipcdavis/status/1486871621600104450
package des.c5inco.material3
import androidx.compose.animation.*
import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
@amal
amal / Tooltip.kt
Last active December 21, 2023 11:25
How to show a tooltip in AndroidX Jetpack Compose?
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
// Tooltip implementation for AndroidX Jetpack Compose
// See usage example in the next file
// Tested with Compose version **1.1.0-alpha06**
// Based on material DropdownMenu implementation.
import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.animateFloat
@darvld
darvld / CircularReveal.kt
Created October 3, 2021 23:03
A circular reveal effect modifier for Jetpack Compose.
package cu.spin.catalog.ui.components
import android.annotation.SuppressLint
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.updateTransition
import androidx.compose.runtime.State
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.Offset