Skip to content

Instantly share code, notes, and snippets.

@rizaumami
rizaumami / xbixon.sh
Created August 23, 2024 09:07
Bash script to build UIX Lite's Icons.xbx.
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# Checking dependencies:
declare -a DEPS=(wget xxd)
for ((NUM=${#DEPS[@]},i=0; i<NUM;i++)); do
if command -v "${DEPS[i]}" &>/dev/null ; then
unset -v 'DEPS[i]'
fi
const Telegraf = require('telegraf')
const bot = new Telegraf(process.env.BOT_TOKEN)
function unescapeHtml(str){
const map = {
amp: '&',
lt: '<',
le: '≤',
gt: '>',
ge: '≥',
@rizaumami
rizaumami / nobot.js
Last active August 23, 2024 09:40
Bot Telegram yang dipasang di zeit.co/now.
const escapeHtml = require('escape-html')
const Telegraf = require('telegraf')
const bot = new Telegraf(process.env.BOT_TOKEN)
function getName(user) {
let name = `<b>${escapeHtml(user.first_name)}</b>`
if (user.last_name) name += ` <b>${escapeHtml(user.last_name)}</b>`
if (user.username) name += ` (@${user.username})`
name += ` [<code>${user.id}</code>]`
@rizaumami
rizaumami / teleBSE
Last active March 3, 2017 08:47
Script Bash untuk mengambil tautan Buku Sekolah Elektronik dari http://bsd.pendidikan.id.
#!/bin/bash
# Script ini untuk mengambil tautan berkas Buku Sekolah Elektronik dari
# http://bsd.pendidikan.id.
#
# Hasil script berupa berkas berisi daftar tautan menuju berkas PDF BSE yang
# kemudian dapat dijadikan input bagi download manager (misal wget).
#
# Sahri Riza Umami @ 2017/02/28 21:22:24 WIB