Skip to content

Instantly share code, notes, and snippets.

View jeluchu's full-sized avatar
😎
Developing with anime

Jesús María jeluchu

😎
Developing with anime
View GitHub Profile
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@rxaviers
rxaviers / gist:7360908
Last active June 18, 2024 06:14
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:
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 11, 2024 14:17
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@jasco
jasco / DialogFragAnim_snippet.java
Created October 5, 2014 00:26
DialogFragment enter/exit animations
// example courtesy of http://adilatwork.blogspot.com/2012/11/android-dialogfragment-enter-and-exit.html
// file location: src/main/java/com/example/
@Override
public void onStart() {
super.onStart();
// safety check
if (getDialog() == null) {
return;
@VAdaihiep
VAdaihiep / PhoneNumberEditText.java
Created March 22, 2016 03:54
EditText auto add space when input phone number (phone number in Vietnam). Example: 01234567890 -> 0123 456 7890
import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DigitsKeyListener;
import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
@oakkub
oakkub / DialogExtensions.kt
Last active December 27, 2023 04:32
Kotlin extension functions for creating AlertDialog in a DSL way
import android.annotation.SuppressLint
import android.app.Activity
import android.app.AlertDialog
import android.content.Context
import android.support.annotation.StringRes
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.widget.Button
import android.widget.TextView
@ar-android
ar-android / ShowHideFab.java
Created January 19, 2018 18:14
Show and Hide Floating Action Button when scrolling recyclerview
// Java
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (dy > 0 && fab.getVisibility() == View.VISIBLE) {
fab.hide();
} else if (dy < 0 && fab.getVisibility() != View.VISIBLE) {
fab.show();
@sofakingforever
sofakingforever / AnimatedStarsView.kt
Last active February 3, 2022 09:21
Draw animated stars on Android view canvas - written in Kotlin - crafted with ❤️ by sofakingforever
package com.sofaking.moonworshipper.view
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.RectF
import android.util.AttributeSet
import android.view.View
import java.util.*
import java.util.concurrent.Executors
// To load an image into an ImageView, use the load extension function.
imageView.load("https://www.example.com/image.jpg")
// Coil supports urls, uris, resources, drawables, bitmaps, files, and more.
imageView.load(R.drawable.image)
imageView.load(File("/path/to/image.jpg"))
imageView.load("content://com.android.externalstorage/image.jpg")
// Requests can be configured with an optional trailing lambda.
imageView.load("https://www.example.com/image.jpg") {
@jemshit
jemshit / MediaPlayerStateMachine.kt
Last active March 16, 2022 15:48
Android MediaPlayer has internal state of its own, but there is no get method for it. State diagram is here: https://developer.android.com/images/mediaplayer_state_diagram.gif. Invocation of method that is not allowed at current state results in exception. To avoid such exception and track states of MediaPlayer, MediaPlayerStateMachine is writte…
import android.util.Log
fun emptyMPStateMachineLogger(tag: String, message: String) {
// NoOp
}
fun defaultMPStateMachineLogger(tag: String, message: String) {
Log.d(tag, message)
}