Skip to content

Instantly share code, notes, and snippets.

View chibaye's full-sized avatar

chibaye chibaye

View GitHub Profile
@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
@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
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 / 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',
@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 / 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 / use-location.js
Created June 17, 2021 16:24 — forked from lenkan/use-location.js
React hook that keeps up to date with the current location.
// @ts-check
import { useState, useEffect } from 'react'
function getCurrentLocation () {
return {
pathname: window.location.pathname,
search: window.location.search
}
}
@chibaye
chibaye / .gitignore
Created June 23, 2021 15:22 — forked from bergie/.gitignore
Node.js email handling examples
config.json
reading-image.png
/**
* Using a single integer to represent multiple permissions
* based on binary values using bitwise operators
*
* & bitwise AND - if both the top and bottom bit are 1, result is 1
* | bitwise OR - if either the top and bottom bit or both are 1, result is 1
* ^ bitwise XOR - if only one of the bits are 1, result is 1
* 0101
* 0100 & = 0100
*
@chibaye
chibaye / README.md
Created July 23, 2021 06:06 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/