Skip to content

Instantly share code, notes, and snippets.

View annahri's full-sized avatar

Muhammad Ahfas An Nahri annahri

View GitHub Profile
@annahri
annahri / cell.pde
Created January 29, 2018 08:43
Game of life in Processing
class Cell {
float x;
float y;
float size;
int state;
public Cell(float x, float y, float size) {
this.x = x;
this.y = y;
this.size = size;
@annahri
annahri / cubewave.pde
Created February 28, 2018 23:33
Cube wave
float angle;
float w = 24;
float maxD;
int num = 16;
void setup() {
size(400, 400, P3D);
smooth(8);
maxD = dist(0, 0, num*w, num*w);
}
@annahri
annahri / teroos.sh
Created December 30, 2019 10:00
Teroos.sh -- Runs a bash script for..ever... until stopped
#!/bin/bash
# teroos - Runs a script for..ever... until stopped
set -eo pipefail
USAGE() {
echo "Usage: $0 <start|stop|status|install|uninstall> /path/to/script.sh"
exit
}
@annahri
annahri / hijri.sh
Created July 14, 2020 02:35
Menampilkan tanggal hari ini dalam penanggalan hijriyah.
#! /usr/bin/env bash
tanggal="$1"
tanggal="${tanggal:-$(date +'%Y-%m-%d')}"
hijri=$(python3 - <<CMD
from ummalqura.hijri_date import HijriDate
from datetime import date
print(HijriDate.get_hijri_date("$tanggal"))
CMD