Skip to content

Instantly share code, notes, and snippets.

View fbongcam's full-sized avatar
💭
Looking for work

fbongcam

💭
Looking for work
  • Earth
View GitHub Profile
@fbongcam
fbongcam / RequestCodeGenerator.java
Last active January 11, 2024 12:52
Simple request code generator
import java.util.Date;
public class RequestCodeGenerator {
public RequestCodeGenerator() {}
public int getCode() {
long timestamp = new Date().getTime();
return Math.abs( (int) timestamp % 100000 );
}
@fbongcam
fbongcam / DeviceMetrics.java
Created February 9, 2022 19:46
Collects useful data of the device physical screen and window components
import android.content.Context;
import android.graphics.Point;
import android.view.WindowManager;
/*
@author Filip Bongcam
DEVICE METRICS
Collects useful data of the device physical screen and window components
/*
@author Filip Bongcam
---------------------
Compare string against custom regex
@param string to analyze
@param regex to compare against
@param if comparision should be case sensitive or not
@return true or false
@fbongcam
fbongcam / dateFormat_collection.swift
Last active May 22, 2021 14:56
Collection of date formats in Swift
/*
Collection of date formats
@author Filip Bongcam
Useful for determining format of date when unknown,
when converting string to date
Usage:
To determine unknown format of date (as String)