Skip to content

Instantly share code, notes, and snippets.

View rhonyabdullah's full-sized avatar
๐Ÿ 
Working from home | Open to new opportunities

Rhony rhonyabdullah

๐Ÿ 
Working from home | Open to new opportunities
  • Jakarta/Indonesia
  • 11:11 (UTC +07:00)
  • LinkedIn in/rhony
View GitHub Profile
@Zhuinden
Zhuinden / FragmentViewBindingDelegate.kt
Last active February 11, 2025 09:25
Fragment view binding delegate
// https://github.com/Zhuinden/fragmentviewbindingdelegate-kt
import android.view.View
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import androidx.viewbinding.ViewBinding
import kotlin.properties.ReadOnlyProperty
@gabrielemariotti
gabrielemariotti / README.MD
Last active September 24, 2024 09:22
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

@agusibrahim
agusibrahim / ConnectionStatus.java
Last active July 3, 2017 00:45
Check Network Connectivity available or not
package ai.agusibrahim.kepooto;
import java.net.Socket;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import android.os.AsyncTask;
import ai.agusibrahim.kepooto.ConnectionStatus.*;
import android.content.Context;
import android.net.ConnectivityManager;
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId "samples.linhtruong.com.ui_reactive_rxjava_realm"
minSdkVersion versions.minSdk
@natchiketa
natchiketa / a Super-simple Nginx reverse proxy with Homebrew on OS X.md
Last active May 18, 2023 04:54
Super-simple Nginx reverse proxy with Homebrew on OS X

Installation

1)

brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgents

2)

Replace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.

@ef2k
ef2k / pf_and_dns.markdown
Last active January 14, 2025 22:44
Port Forwarding and Domain Tricks (macOS High Sierra)

This guide enables port forwarding for foo.com to localhost:3000. Tested on macOS High Sierra.

Add the domain to /etc/hosts

$ sudo nvim /etc/hosts

Add the following:

package com.firebase.utils;
import java.util.Date;
/**
* Fancy ID generator that creates 20-character string identifiers with the
* following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't
@rxaviers
rxaviers / gist:7360908
Last active April 22, 2025 01:30
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@samsonjs
samsonjs / scale.java
Created September 10, 2012 20:13
Scale a Bitmap preserving the aspect ratio
// Scale a bitmap preserving the aspect ratio.
private Bitmap scale(Bitmap bitmap, int maxWidth, int maxHeight) {
// Determine the constrained dimension, which determines both dimensions.
int width;
int height;
float widthRatio = (float)bitmap.getWidth() / maxWidth;
float heightRatio = (float)bitmap.getHeight() / maxHeight;
// Width constrained.
if (widthRatio >= heightRatio) {
width = maxWidth;