This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pip install -U Pygments --user | |
echo "alias pcat='pygmentize -g -O style=colorful,linenos=1'" >> ~/.bashrc | |
echo "done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import NoReturn | |
import asyncio | |
import time | |
from random import randint | |
nilai: int = 0 | |
start: int = time.time() | |
async def simulasiProg() -> NoReturn: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The function below use the latitude and longitude of two locations, and calculate the distance between them in both miles and metric units. | |
function getDistanceBetweenPointsNew($latitude1, $longitude1, $latitude2, $longitude2) { | |
$theta = $longitude1 - $longitude2; | |
$miles = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))); | |
$miles = acos($miles); | |
$miles = rad2deg($miles); | |
$miles = $miles * 60 * 1.1515; | |
$feet = $miles * 5280; | |
$yards = $feet / 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//default time zone | |
date_default_timezone_set("Asia/Jakarta"); | |
//fungsi check tanggal merah | |
function tanggalMerah($value) { | |
$array = json_decode(file_get_contents("https://raw.githubusercontent.com/guangrei/APIHariLibur_V2/main/calendar.json"),true); | |
//check tanggal merah berdasarkan libur nasional | |
if(isset($array[$value]) && $array[$value]["holiday"]) | |
: echo"tanggal merah\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//configuration | |
$key="API key"; | |
$event="event_name"; | |
//data | |
$data=json_encode(array( "value1"=>"data for value1","value2"=>"data for value2","value3"=>"data for value3")); |
NewerOlder