Skip to content

Instantly share code, notes, and snippets.

View inromualdo's full-sized avatar
🏠
Working from home

Romuald DANSOU inromualdo

🏠
Working from home
  • Cotonou BENIN
  • 00:24 (UTC +01:00)
View GitHub Profile
@inromualdo
inromualdo / docker-compose.yml
Created February 26, 2023 16:43 — forked from pyrou/docker-compose.yml
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
@inromualdo
inromualdo / EndlessRecyclerOnScrollListener.java
Created August 18, 2018 05:13 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@inromualdo
inromualdo / Hex Opacity Values
Created May 26, 2018 04:16
Android uses hexadecimal ARGB values, which are formatted as #AARRGGBB. That first pair of letters, the AA, represent the alpha channel. You must convert your decimal opacity values to a hexadecimal value
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
@inromualdo
inromualdo / DpToPxAndPxToDp
Created February 24, 2018 14:36 — forked from laaptu/DpToPxAndPxToDp
Android convert dp to px and vice versa
public static float convertPixelsToDp(float px){
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float dp = px / (metrics.densityDpi / 160f);
return Math.round(dp);
}
public static float convertDpToPixel(float dp){
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float px = dp * (metrics.densityDpi / 160f);
return Math.round(px);
@inromualdo
inromualdo / styles.xml
Created April 30, 2017 03:23 — forked from Aracem/styles.xml
Material Text Styles supported for all version with Appcompat + Calligraphy Library ( https://github.com/chrisjenx/Calligraphy ) Material Design recomendations http://www.google.com/design/spec/style/typography.html#typography-roboto-noto Remember to add the fonts to your source/fonts folder
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- TextView Empty Base-->
<style name="TextViewBase" parent="android:TextAppearance.Holo.Widget.TextView"/>
<!-- ActionBar Title -->
<style name="CustomActionBarTitleBase" parent="TextAppearance.AppCompat.Widget.ActionBar.Title"/>
<!-- Text Views Default Base -->
@inromualdo
inromualdo / draft_billet_macos.md
Created October 29, 2016 11:38 — forked from dgageot/draft_billet_macos.md
Installation git sous OSX

MacOS est un Unix, et à ce titre, l'installation de git n'est pas trop compliqué :). Pour résumé, vous avez 2 méthodes :

  • installer une version déjà compilée par un tiers
  • installer une version source

Cette dernière méthode est plus contraignante, votre système doit contenir le nécessaire pour compiler (compilateur GCC, outil Make et Autoconf...). Les utilisateurs d'Unix libres (Linux, *BSD) ne seront pas étonnés par ces 2 méthodes d'installation.

Installer une version compilée

Pour ceux qui souhaitent ne pas "se prendre la tête", Il existe le projet Git OSX Installer, qui permet d'installer simplement git sur Mac OS X 10.5 uniquement. Vous pouvez constater que le projet est actif (au 30/11/2010, la version 1.7.3.1 est disponible alors que la dernière version est la 1.7.3.2).

<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
gist atom