Skip to content

Instantly share code, notes, and snippets.

View ronjunevaldoz's full-sized avatar
🎯
Focusing

Ron June Valdoz ronjunevaldoz

🎯
Focusing
View GitHub Profile
@antonshilov
antonshilov / TreeRenderer.kt
Last active July 1, 2024 18:49
Simple tree hierarchy rendering with Jetpack Compose
package com.example.myapplication
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.Box
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
@lovubuntu
lovubuntu / Sha256.kt
Created November 24, 2017 15:58
function to generate Sha-256 in Kotlin
Class Hasher {
fun hash(): String {
val bytes = this.toString().toByteArray()
val md = MessageDigest.getInstance("SHA-256")
val digest = md.digest(bytes)
return digest.fold("", { str, it -> str + "%02x".format(it) })
}
}
@jimschubert
jimschubert / .gitignore
Last active November 16, 2023 04:16
Prototyping a Flags/Bitmasks implementation in Kotlin 1.1.1
META-INF/
*.class
@LouisCAD
LouisCAD / BitFlags.kt
Last active December 24, 2022 16:28
Allows simple bit flags operation on int values in kotlin. Now available in Splitties: https://github.com/LouisCAD/Splitties/tree/master/modules/bitflags Inspired by: http://stackoverflow.com/a/40588216/4433326
@file:Suppress("NOTHING_TO_INLINE")
import kotlin.experimental.and // Used for Byte
import kotlin.experimental.inv // Used for Byte
import kotlin.experimental.or // Used for Byte
inline fun Int.hasFlag(flag: Int) = flag and this == flag
inline fun Int.withFlag(flag: Int) = this or flag
inline fun Int.minusFlag(flag: Int) = this and flag.inv()
@xoppa
xoppa / outline.fragment.glsl
Created October 12, 2015 20:42
very basic outline shader
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
const float offset = 1.0 / 128.0;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
@wmandai
wmandai / Codeigniter IIS web.config
Last active August 11, 2023 06:24
IIS web.config for codeigniter
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Index">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
@mnewt
mnewt / bootstrap-tabs.html
Created December 6, 2012 20:28
bootstrap tabs example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>