Skip to content

Instantly share code, notes, and snippets.

@atmorojo
atmorojo / latihan_kasir.html
Last active November 15, 2024 01:07
Simple POS MUHPAT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kasir Sederhana</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
require "credentials"
wifi.setmode(wifi.STATION)
print('set mode=STATION (mode='..wifi.getmode()..')')
print('MAC: ',wifi.sta.getmac())
print('chip: ',node.chipid())
print('heap: ',node.heap())
pin = 4
#!/bin/sh
service_dir=$HOME/.local/share/kio/servicemenus
mkdir -p $service_dir
cd $service_dir
curl -s https://gist.githubusercontent.com/atmorojo/e80d1add29636e64f41a4656d33afced/raw/4c9a86697125ee9562d01a89a984bf010c688b3d/compress_pdf.desktop -o compress_pdf.desktop
[Desktop Entry]
Type=Service
MimeType=application/pdf;
Actions=compressPDF
[Desktop Action compressPDF]
Name=Compress PDF
Exec=sh -c "exec gs -q -dNOPAUSE -dBATCH -dSAFER -dSimulateOverprint=true -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dEmbedAllFonts=true -dSubsetFonts=true -dAutoRotatePages=/None -dColorImageDownsampleType=/Bicubic -dColorImageResolution=150 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=150 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=150 -sOutputFile=[compressed]-$(echo %f | awk -F '/' '{print $(NF)}') %f"
@atmorojo
atmorojo / qurancomplex.sh
Last active April 23, 2026 22:52
A script to download Quran Complex fonts
#!/usr/bin/env bash
echo "If the script failed, you might want to make sure bash, wget, and unzip is installed on your Computer\n\n\n"
# Important variables
tmpdir="/tmp/QuranComplex/"
targetdir="$HOME/.fonts/QuranComplex/"
IFS=$'\n' # make newline the only separator. So we don't need to escape spaces
declare -a source=(
console.clear();
Array.prototype.forEach.call(
document.getElementsByClassName("_icyx7"),
function (a) {
console.log(a.src);
});
@atmorojo
atmorojo / cvimrc
Created February 18, 2017 15:29
cvimrc
set autoupdategist
set noautofocus
set nocncpcompletion
set smoothscroll
set hud
set noregex
set noinsertmappings
set typelinkhints
set defaultnewtabpage
let scrollduration = 10
@atmorojo
atmorojo / gifit
Created December 25, 2015 10:39
Create gif screencast with ffmpeg
#!/bin/sh
giftmp=/tmp/outXXXXXXXXXX.gif
unset x y w h
eval $(xwininfo |
sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
-e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
-e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
-e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" )