Skip to content

Instantly share code, notes, and snippets.

View iurysza's full-sized avatar
📱
Mobile stuff

iury souza iurysza

📱
Mobile stuff
View GitHub Profile
@thomashorta
thomashorta / FadingEdgesModifier.kt
Last active December 29, 2023 03:58
FadingEdgesModifier class which add fading edges Modifiers to be used with verticalScroll and horizontalScroll Modifiers.
/*
* Written by Thomás Horta, 2023-12-21.
*/
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.verticalScroll
import androidx.compose.ui.Modifier
(*
Toggle GlobalProtect VPN with AppleScript
Tested using macOS Ventura 13.4.1 and GlobalProtect version 6.2.0-89
Written by Trevor Manternach, August 2023.
*)
tell application "System Events" to tell process "GlobalProtect"
click menu bar item 1 of menu bar 2
set statusText to name of static text 1 of window 1
if statusText is "Not Connected" then
@CodyBohn
CodyBohn / Maxis Loading Messages.txt
Last active January 26, 2024 15:49
Compiled list of loading messages from the Sims games
Abolishing Pedestrian Posturing
Abstracting Loading Procedures
Activating Deviance Threshold
Activating Hotel Staff
Activating Story Arc
Adapting Behavioral Model
Adding Hidden Agendas
Adjusting Acceptable Apparel
Adjusting Bell Curves
Adjusting Emotional Weights
@alexforrester
alexforrester / Moshi Kotlin Codegen Example with Custom Adapter
Last active August 28, 2022 19:39
Moshi Kotlin Codegen Example with Custom Adapter
//app build.gradle
apply plugin: 'kotlin-kapt'
...
dependencies {
{
//Moshi Core
implementation "com.squareup.moshi:moshi:1.8.0"
//Moshi Codegen
@skydoves
skydoves / RecyclerViewPaginator.kt
Created March 16, 2018 02:44
RecyclerViewPaginator
class RecyclerViewPaginator(val recyclerView: RecyclerView,
val isLoading: () -> Boolean,
val loadMore: (Int) -> Unit,
val onLast: () -> Boolean = { true }): RecyclerView.OnScrollListener() {
private val threshold = 10
private var currentPage: Int = 0
init {
recyclerView.addOnScrollListener(this)
@meain
meain / loading_messages.js
Last active April 27, 2024 09:54
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@phit
phit / gradlesigning.md
Last active May 28, 2022 08:50
Gradle Signing for Dummies
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 11, 2024 15:02
React Native Bridging Cheatsheet
@max-vogler
max-vogler / TravellingSalesMan.kt
Created February 5, 2016 14:19
Solving the Travelling Salesman Problem with Kotlin and JGraphT (done for AdventOfCode day 9)
// use regular Java imports: Kotlin is 100% compatible to Java
import org.jgrapht.DirectedGraph
import org.jgrapht.Graph
import org.jgrapht.graph.SimpleDirectedGraph
/**
* A class defining an Edge in the Graph. The `val`s are automatically accessible via getters.
* Additionally, the annotation `data`automatically generates equals(), hashcode() and more.
*/
data class Edge(val source: String, val target: String, val duration: Int)