Skip to content

Instantly share code, notes, and snippets.

View philipborbon's full-sized avatar

Philip Borbon philipborbon

View GitHub Profile
@philipborbon
philipborbon / .gitconfig
Last active October 7, 2019 03:25
Sample Git Config For Windows
[user]
name = Philip Borbon
email = philip@crescit.com
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
@philipborbon
philipborbon / HeaderItemDecoration.kt
Last active October 7, 2019 03:23 — forked from filipkowicz/HeaderItemDecoration.kt
Item Decorator for sticky headers in Kotlin
/*
solution based on - based on Sevastyan answer on StackOverflow
changes:
- take to account views offsets
- transformed to Kotlin
- now works on viewHolders
- try to cache viewHolders between draw's
@philipborbon
philipborbon / env.autoload.php
Created July 5, 2019 05:44
PHP .env Sample Implementation
<?php
/**
* Create .env file in same directory in following format
* DB_HOST=localhost
* DB_USERNAME=username
* DB_PASSWORD=password
*
*
* Usage:
*
@philipborbon
philipborbon / RetrofitSingleton.kt
Created May 20, 2019 08:23
Retrofit Singleton Factory
companion object Factory {
@Volatile
private var retrofit : Retrofit? = null
@Synchronized
fun getInstance(baseUrl: String, tokenStorage: TokenStorage): FireResponseService? {
retrofit = retrofit ?: synchronized(this) {
retrofit ?: buildRetrofit(baseUrl, tokenStorage)
}
@philipborbon
philipborbon / ClickToSelectEditText.java
Created March 22, 2019 07:37 — forked from rodrigohenriques/ClickToSelectEditText.java
Used to make your EditText a better option than Spinners
public class ClickToSelectEditText<T extends Listable> extends AppCompactEditText {
List<T> mItems;
String[] mListableItems;
CharSequence mHint;
OnItemSelectedListener<T> onItemSelectedListener;
public ClickToSelectEditText(Context context) {
super(context);
@philipborbon
philipborbon / HTTPStatusCodes.swift
Created December 4, 2018 02:24 — forked from brennanMKE/HTTPStatusCodes.swift
Swift Enums for HTTP Status Codes
enum HTTPStatusCodes: Int {
// 100 Informational
case Continue = 100
case SwitchingProtocols
case Processing
// 200 Success
case OK = 200
case Created
case Accepted
case NonAuthoritativeInformation