Skip to content

Instantly share code, notes, and snippets.

View bmuthoga's full-sized avatar

Batian Muthoga bmuthoga

View GitHub Profile
@bmuthoga
bmuthoga / momentjs.humanized.triplesplit.time.js
Created March 28, 2019 21:41 — forked from James1x0/momentjs.humanized.triplesplit.time.js
Get a humanized, "Morning", "Afternoon", "Evening" from moment.js **Great for user greetings!**
function getGreetingTime (m) {
var g = null; //return g
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return.
var split_afternoon = 12 //24hr time to split the afternoon
var split_evening = 17 //24hr time to split the evening
var currentHour = parseFloat(m.format("HH"));
if(currentHour >= split_afternoon && currentHour <= split_evening) {
@bmuthoga
bmuthoga / Resume.md
Last active April 21, 2020 21:07
Resume for Batian Muthoga
@bmuthoga
bmuthoga / Github Webhook Tutorial.md
Created July 25, 2020 11:31 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings