Skip to content

Instantly share code, notes, and snippets.

View Risyandi's full-sized avatar
🌴
Everyday is a vacation

Risyandi Risyandi

🌴
Everyday is a vacation
View GitHub Profile
@Risyandi
Risyandi / anilistCard.json
Created July 26, 2023 04:33
query graphQL example for API anilist
{
"query": "query($season:MediaSeason,$seasonYear:Int $nextSeason:MediaSeason,$nextYear:Int){trending:Page(page:1,perPage:6){media(sort:TRENDING_DESC,type:ANIME,isAdult:false){...media}}season:Page(page:1,perPage:6){media(season:$season,seasonYear:$seasonYear,sort:POPULARITY_DESC,type:ANIME,isAdult:false){...media}}nextSeason:Page(page:1,perPage:6){media(season:$nextSeason,seasonYear:$nextYear,sort:POPULARITY_DESC,type:ANIME,isAdult:false){...media}}popular:Page(page:1,perPage:6){media(sort:POPULARITY_DESC,type:ANIME,isAdult:false){...media}}top:Page(page:1,perPage:10){media(sort:SCORE_DESC,type:ANIME,isAdult:false){...media}}}fragment media on Media{id title{userPreferred}coverImage{extraLarge large color}startDate{year month day}endDate{year month day}bannerImage season seasonYear description type format status(version:2)episodes duration chapters volumes genres isAdult averageScore popularity mediaListEntry{id status}nextAiringEpisode{airingAt timeUntilAiring episode}studios(isMain:true){edges{isMain nod
@Risyandi
Risyandi / eigerPalindrome.js
Created March 14, 2024 03:09
palindrome code test for eigerindo
// checking if the text is palindrome
function palindrome(string) {
let result = true;
let lengthString = string.length;
let indexJ = lengthString - 1;
for (let index = 0; index < lengthString / 2; index++) {
if (string[index] != string[indexJ]) {
@Risyandi
Risyandi / timeConversion.go
Created April 5, 2024 13:50
time conversion from 12 hours to 24 hours.
package main
import (
"fmt"
"strings"
"strconv"
)
// Timeconversion is your solution code.
func Timeconversion (s string) string {
@Risyandi
Risyandi / getUrlInElementSaveToFile.js
Created June 29, 2024 15:28
get url in element and saved to text file
// class you can modify based on the target
// count length of element base on the target
let arrayValue = [];
let element = document.querySelectorAll('.project-cell.gl-w-11 a');
let length = document.querySelectorAll('.project-cell.gl-w-11 a').length;
for (let index = 0; index < length; index++) {
// get value of href in the element
// push value to array
let result = element[index].href;
arrayValue.push(result);
@Risyandi
Risyandi / clean_code.md
Created March 14, 2025 17:10 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules