Skip to content

Instantly share code, notes, and snippets.

View chibaye's full-sized avatar

chibaye chibaye

View GitHub Profile
@chibaye
chibaye / SMSReceiver.java
Created June 17, 2021 11:32 — forked from chathudan/SMSReceiver.java
Android SMS Receive Listener
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import java.util.ArrayList;
/**
* @@author Chathura Wijesinghe <[email protected]>
@chibaye
chibaye / AutoResizeTextView.java
Created June 17, 2021 11:31 — forked from chathudan/AutoResizeTextView.java
Text view that auto adjusts text size to fit within the view. If the text size equals the minimum text size and still does not fit, append with an ellipsis.
import android.content.Context;
import android.text.Layout.Alignment;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
/**
* Text view that auto adjusts text size to fit within the view.
@chibaye
chibaye / youversion_abbreviations.js
Created June 8, 2021 05:45 — forked from danott/youversion_abbreviations.js
YouVersion.com URL Abbreviations
/*!
* youversion_abbreviations.js
* JSON of YouVersion.com Bible Book URL Abbreviations.
*/
var books = {
'gen': 'Genesis',
'exo': 'Exodus',
'lev': 'Leviticus',
'num': 'Numbers',
'deu': 'Deuteronomy',
package test;
import android.arch.lifecycle.LiveData;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
@chibaye
chibaye / lvh_ssl.md
Created April 3, 2021 11:37 — forked from dagjaneiro/lvh_ssl.md
lvh.me ssl

Install nginx

$ brew install nginx

Edit nginx.conf

$ vim /usr/local/etc/nginx/nginx.conf
@chibaye
chibaye / curl.md
Created March 2, 2021 18:32 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
#ONE FOR EACH NEXTJS APP AND SUBDOMAIN
#BIKES - PORT 3001
@chibaye
chibaye / genymotionwithplay.txt
Created June 17, 2020 18:46 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@chibaye
chibaye / ReadWriteExcelFile.java
Created June 13, 2020 14:03 — forked from madan712/ReadWriteExcelFile.java
Read / Write Excel file (.xls or .xlsx) using Apache POI
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@chibaye
chibaye / Enum.es6.js
Created June 12, 2020 15:36 — forked from stefanwalther/Enum.es6.js
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;