Skip to content

Instantly share code, notes, and snippets.

View nyancodeid's full-sized avatar
❤️
Do what you love, love what you do

Ryan Aunur Rassyid nyancodeid

❤️
Do what you love, love what you do
View GitHub Profile
@nyancodeid
nyancodeid / index.ts
Created April 6, 2024 20:59
Browser: Turn Uint8Array into ImageData
function bufferIntoImageData (data: Uint8Array): Promise<ImageData> {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d', {
willReadFrequently: true
});
if (!context) {
throw new Error('Canvas context is not available.');
}
@nyancodeid
nyancodeid / README.md
Last active December 17, 2021 10:47
DenoQL Showcase
@nyancodeid
nyancodeid / schema.graphql
Created December 9, 2021 15:56
DenoQL: GraphQL Schema
type Query {
page(
# A URL to fetch the HTML source from.
url: String
# A string containing HTML to be used as the source document.
source: String
): Document
}
@nyancodeid
nyancodeid / BubbleSortTest.java
Last active November 12, 2021 03:04
Benchmark Test Sorting Algorithm
public class BubbleSortTest {
public static void main(String[] args) {
long waktuMulai = 0;
long waktuSelesai = 0;
int[] iniDataSebelumDiurut;
// Test untuk 1.000 data
waktuMulai = System.currentTimeMillis();
@nyancodeid
nyancodeid / README.md
Created July 19, 2021 13:05
Fetch With Progress

Fetch with Progress (XMLHttpRequest Implementation)

/**
 *
 * @param {String} url
 * @param opts
 * @param {Function} onProgress
 * @returns {Promise<String>}
 */
@nyancodeid
nyancodeid / RyanAunurR_T382.java
Created February 4, 2021 10:53
Tugas Praktikum 3.8 - 2
/**
* @author Ryan Aunur Rassyid
**/
import java.io.*;
public class RyanAunurR_T382 {
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
@nyancodeid
nyancodeid / README.md
Created December 27, 2020 11:18
Laravel 8 - Localization Indonesian Language

Laravel 8 - Localization Indonesian Language

Laravel 8 localization file untuk bahasa indonesia.

Put this file into your laravel project with following path: Letakkan file ini di laravel project kamu di folder berikut:

./resources/lang/id/{filename}.php

To make it as a default language and english as a fallback, set locale attribute value inside of ./config/app.php file to be id. Untuk menjadikan bahasa indonesia sebagai bahasa utama dan bahasa inggris sebagai alternatif, maka set nilai atribut locale pada file ./config/app.php menjadi id

@nyancodeid
nyancodeid / javascript-sort.js
Created August 11, 2020 16:17
Sorting in Javascript
/**
* @function
* @template T
* @param {T} item
* @return {Promise.<T>}
*/
const sortItem = function (item) {
return new Promise((resolve, reject) => {
setTimeout(() => {
this.store(item);
@nyancodeid
nyancodeid / docker-compose.yml
Created August 10, 2020 15:02
Docker Compose
version: "3.7"
services:
database:
image: mongo:latest
container_name: database-service
environment:
- MONGO_INITDB_DATABASE=appdb
- MONGO_INITDB_ROOT_USERNAME=appdb_user
- MONGO_INITDB_ROOT_PASSWORD=appdb_password
@nyancodeid
nyancodeid / list-song.txt
Created August 3, 2020 13:09
chill songs for when I want a relaxed night (english, k-r&b and lofi)
(0:00) 01. Bye Bye Badman - 너의 파도/Your Wave
(3:56) 02. O.O.O - 눈이 마주쳤을 때
(7:11) 03. O.O.O - Darkroom
(10:26) 04. Were Are The Night - Where Are You
(14:19) 05. Night Off - Today's Weather was a Failure
(17:40) 06. Bye Bye Badman - Always in Love
(21:32) 07. We Are The Night - Club Midnight
(25:29) 08. Shin Hae Gyeong - 그대의 꿈결 feat.김사월
(30:21) 09. Were Are The Night - Maybe