Skip to content

Instantly share code, notes, and snippets.

View rama-adi's full-sized avatar
🎯
Focusing

Rama Adi Nugraha rama-adi

🎯
Focusing
View GitHub Profile
@rama-adi
rama-adi / PolygonChecker.php
Created April 28, 2023 05:46
A PHP class to check if a set of vertices is inside a polygon.
<?php
/**
* Class PolygonChecker
*
* Represents a polygon shape and checks whether a set of vertices are inside the polygon.
*/
class PolygonChecker
{
private array $vertices;
@rama-adi
rama-adi / Color.kt
Last active December 11, 2022 20:54
Tailwind CSS colors for jetpack compose
import androidx.compose.ui.graphics.Color
//Tailwind Colors
// Shade: slate
val Slate50 = Color(0xFFF8FAFC)
val Slate100 = Color(0xFFF1F5F9)
val Slate200 = Color(0xFFE2E8F0)
val Slate300 = Color(0xFFCBD5E1)
val Slate400 = Color(0xFF94A3B8)
@rama-adi
rama-adi / README.MD
Last active December 11, 2022 20:52
Tailwind CSS Colors for Android XML

Tailwind CSS colors for Android XML Color

This is the official color palletes of Tailwind CSS in colors.xml format for all of your Android color needs

How to use

Just copy the contents of colors.xml into your colors.xml file and you can instantly use all of the palletes provided by Tailwind CSS

Credits

@rama-adi
rama-adi / README.MD
Created December 6, 2021 18:35
Use hCaptcha with any livewire component

Implement hCaptcha with Livewire Component

This is a simple way to implement hCaptcha with Livewire component.

NOTE: please read this carefully, and adjust variable names, etc to your use case

Setup

Before using this implementation, add their JS library first on your page

<script src="https://js.hcaptcha.com/1/api.js?hl=en" async defer></script>
async function resolveUid(client, username) {
const parsed_username = username.replace('@', '');
return (typeof username === 'undefined' || username === '')
? {resolved: false, uid: null}
: (
(typeof await client.users.get(username).id === 'undefined')
? {resolved: false, uid: null}
: {resolved: true, uid: await client.users.get(username).id}
);
}
@rama-adi
rama-adi / Locales-in-laravel-id.md
Last active October 6, 2020 16:33
Contoh Localization di Laravel
  1. Add di routes/web.php
Route::get('locale/{locale}', [localeController::class, 'change']);
  1. App\Http\Controllers\LocaleController.php
<?php

namespace App\Http\Controllers;