Skip to content

Instantly share code, notes, and snippets.

View sab99r's full-sized avatar

Sabeer sab99r

View GitHub Profile
@akmalxxx
akmalxxx / HijriCalendar.java
Last active April 8, 2018 08:53
Umm Al-Qura Java Calendar
/*
Umm Al-Qura Islamic Calendar
valid from 1356 AH (14 March 1937 CE) to 1500 AH (16 November 2077 CE).
Outside this interval, the converter will give erroneous results.
ported from javascript from:
http://www.staff.science.uu.nl/~gent0113/islam/ummalqura_converter.htm#top
*/
import java.util.Calendar;
@staltz
staltz / introrx.md
Last active May 12, 2026 01:57
The introduction to Reactive Programming you've been missing
@Kursulla
Kursulla / Self signing certificate: Android and Retrofit
Last active November 13, 2018 16:58
Self signing certificate: Android and Retrofit
Enabling communication with API if server has Self-Signed Certificate
/// <summary>
/// A listing of ASCII control characters for readability.
/// </summary>
public static class AsciiControlChars
{
/// <summary>
/// Usually indicates the end of a string.
/// </summary>
public const char Nul = (char)0x00;
@alexfu
alexfu / EqualSpacingItemDecoration.java
Last active September 17, 2024 09:36
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
//client
RequestBody previewImg =
RequestBody.create(MediaType.parse("image/jpeg"), opts.getPreviewImageFile()); //File
RequestBody thumbnailImg =
RequestBody.create(MediaType.parse("image/jpeg"), opts.getThumbnailImageFile()); //File
RequestBody ownedProductId =
RequestBody.create(MediaType.parse("multipart/form-data"), opts.getOwnedProductId()); //String
//Retrofit interface
@Multipart
@andreibosco
andreibosco / creative-cloud-disable.md
Last active December 19, 2024 08:28
disable creative cloud startup on mac
@CyberPunkCodes
CyberPunkCodes / killadobe.sh
Last active November 21, 2022 16:41
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
#!/bin/bash
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active December 2, 2025 15:44
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
abstract class SharedPreferenceLiveData<T> extends LiveData<T> {
SharedPreferences sharedPrefs;
String key;
T defValue;
public SharedPreferenceLiveData(SharedPreferences prefs, String key, T defValue) {
this.sharedPrefs = prefs;
this.key = key;
this.defValue = defValue;