Skip to content

Instantly share code, notes, and snippets.

View muhrizqiardi's full-sized avatar
✍️
learning!

Muhammad Rizqi Ardiansyah muhrizqiardi

✍️
learning!
View GitHub Profile
@muhrizqiardi
muhrizqiardi / le.sh
Created May 22, 2023 13:27
File tree explorer alternative for Helix Editor in i3
#!/bin/bash
while [ true ]
do
destfile=$(twf)
i3-msg "focus parent; focus right; exec \"i3-sensible-terminal -e hx $destfile\""
done
@muhrizqiardi
muhrizqiardi / useError.tsx
Last active December 30, 2022 01:49
React Error Hook
import { useState } from "react";
export default function useError(
initialIsError: boolean,
initialErrorMessage: string = ""
) {
const [isError, setIsError] = useState<boolean>(initialIsError);
const [errorMessage, setErrorMessage] = useState<string>(initialErrorMessage);
const setError = (isError: boolean, errorMessage: string = "") => {
@muhrizqiardi
muhrizqiardi / analyze-images.py
Created September 23, 2021 14:31
analyze-images.py solution for Integrate with Machine Learning APIs: Challenge Lab (GSP329) 2021
import os
import sys
# Import Google Cloud Library modules
from google.cloud import storage, bigquery, language, vision, translate_v2
if ('GOOGLE_APPLICATION_CREDENTIALS' in os.environ):
if (not os.path.exists(os.environ['GOOGLE_APPLICATION_CREDENTIALS'])):
print ("The GOOGLE_APPLICATION_CREDENTIALS file does not exist.\n")
exit()