Skip to content

Instantly share code, notes, and snippets.

Working from anywhere

Raphaël Bussa raphaelbussa

Working from anywhere
View GitHub Profile
View SectionAdapter.kt
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
abstract class SectionAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val headerPositions: MutableMap<Int, Int> = mutableMapOf()
private val itemPositions: MutableMap<Int, Int> = mutableMapOf()
private val sectionItemPositions: MutableMap<Int, Int> = mutableMapOf()
private var listSize = 0
private var headerSize = 0
ziadoz /
Last active Sep 20, 2021
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# Versions
raphaelbussa /
Last active Oct 30, 2018
Helper for inflate custom layout in google support design snackbar
* The MIT License (MIT)
* Copyright (c) 2016 Raphaël Bussa
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
RyanRamchandar /
Last active Sep 8, 2021
Cancel a running or queued Call with OkHttp3
// ...
Request request = new Request.Builder()
// Cancel previous call(s) if they are running or queued
OkHttpUtils.cancelCallWithTag(client, TAG);
// New call
ygotthilf /
Last active Sep 23, 2021
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out
cat jwtRS256.key
kabouzeid /
Created Jun 22, 2015
A simple helper class for Android to read and write any serializeable object to the internal storage
package com.kabouzeid.gramophone.util;
import android.content.Context;
View empty-wp-plugin.php
* Plugin Name: Name Of The Plugin
* Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Description: A brief description of the Plugin.
* Version: The Plugin's Version Number, e.g.: 1.0
* Author: Name Of The Plugin Author
* Author URI: http://URI_Of_The_Plugin_Author
* License: A "Slug" license name e.g. GPL2
* Copyright (C) 2006 The Android Open Source Project
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
bichotll /
Last active Apr 25, 2019
Load disqus comments with a htmlview in Android
public void onCreate(Bundle savedInstanceState) {
String htmlComments = getHtmlComment("yourId", "yourShortName");
webDisqus = (WebView) findViewById(;
// set up disqus
WebSettings webSettings2 = webDisqus.getSettings();