Skip to content

Instantly share code, notes, and snippets.

@iamriajul
iamriajul / GlideImageGetter.kt
Last active October 16, 2023 05:48
Custom Html.ImageGetter to load images in TextView HTML tags using Glide
/*
* Based on java code by Yaser Rajabi https://gist.github.com/yrajabi
*/
package org.dailyislam.android.utils.extenstions
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.text.Html.ImageGetter
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by mladenrakonjac on 01/06/16.
*/
public class ServiceGenerator {
@HugoGresse
HugoGresse / ClearSurface API16
Created May 28, 2015 09:57
ClearSurface API16
private void clearSurface(SurfaceTexture texture) {
EGL10 egl = (EGL10) EGLContext.getEGL();
EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
egl.eglInitialize(display, null);
int[] attribList = {
EGL10.EGL_RED_SIZE, 8,
EGL10.EGL_GREEN_SIZE, 8,
EGL10.EGL_BLUE_SIZE, 8,
EGL10.EGL_ALPHA_SIZE, 8,
@will3942
will3942 / app.rb
Last active July 20, 2022 00:53
Reverse-Engineering Instagram
require 'openssl'
require 'base64'
require 'json'
require 'httpclient'
http = HTTPClient.new(:agent_name => useragent)
key = "" #The Private key
login_info = {:guid => "00000000-0000-0000-0000-000000000000",
:password => "PASSWORD",
:username => "USERNAME",
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 16:07
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@gilbertwat
gilbertwat / AppLocaleDatePickerDialog.java
Created January 25, 2013 03:40
DatePickerDialog that honors the locale set by the app
package com.gilbert.wat.widget;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Calendar;
import android.app.DatePickerDialog;
import android.content.Context;
import android.os.Build;
import android.widget.DatePicker;