Skip to content

Instantly share code, notes, and snippets.

View nurandi's full-sized avatar

Nur Andi Setiabudi nurandi

View GitHub Profile
@nurandi
nurandi / send_teams.sh
Last active December 6, 2023 12:28
V2 - Send job notification in bash to Teams channel using incoming webhook. jq needed
#!/bin/bash
# version 2.0
# {jq} needed
#
# Make sure to add teams incoming webhook URL to global variable :
# export WEBHOOK_URL={your webhook URL}
# Help.
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
@nurandi
nurandi / shiny-oauth.r
Created December 1, 2023 10:36 — forked from hadley/shiny-oauth.r
Sketch of shiny + oauth
library(shiny)
library(httr)
# OAuth setup --------------------------------------------------------
# Most OAuth applications require that you redirect to a fixed and known
# set of URLs. Many only allow you to redirect to a single URL: if this
# is the case for, you'll need to create an app for testing with a localhost
# url, and an app for your deployed app.
@nurandi
nurandi / send_teams.sh
Last active November 22, 2023 14:02
Send job notification in bash to Teams channel using incoming webhook
#!/bin/bash
# (c) @nurandi
# Make sure to add teams incoming webhook URL to ~/.bashrc :
# export WEBHOOK_URL={your webhook URL}
source ~/.bashrc
# Help.
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
@nurandi
nurandi / R-shades-of-grey.R
Last active August 29, 2015 14:15
Creating grey colours palette in R
# Grey colours palette in R
# Credit to
# . Code: http://research.stowers-institute.org/efg/R/Color/Chart/
# . Graphics: http://www.mango-solutions.com/wp/2015/02/50-shades-of-grey-according-to-r
greys = grep("^grey", colours(), value = TRUE)
colCount <- 6
rowCount <- 17
plot( c(1,colCount), c(0,rowCount), type="n", ylab="", xlab="",
axes=FALSE, ylim=c(rowCount,0))
# Menghitung frequensi per kata
text = readLines("pidato-presiden.txt")
text = unlist(strsplit(text, "\\W+"))
text = tolower(text)
text = data.frame(table(text))
# Menghapus stop-words
stopw = readLines("stopwords-id.txt")
text = text[!is.element(text$text, stopw),]