Skip to content

Instantly share code, notes, and snippets.

View Aldhanekaa's full-sized avatar
🎏
Make Indonesia great again!

Aldhanekai Aldhanekaa

🎏
Make Indonesia great again!
View GitHub Profile
// Welcome to the TypeScript Playground, this is a website
// which gives you a chance to write, share and learn TypeScript.
// You could think of it in three ways:
//
// - A place to learn TypeScript in a place where nothing can break
// - A place to experiment with TypeScript syntax, and share the URLs with others
// - A sandbox to experiment with different compiler features of TypeScript
const anExampleVariable = "Hello World"
@Aldhanekaa
Aldhanekaa / bmi.cpp
Last active January 17, 2021 06:43
#include <iostream>
#include <stdlib.h>
using namespace std;
// g++ bmi.cpp -o bmi && ./bmi
int main()
{
// bmi = weight / height ** 2
'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
@Aldhanekaa
Aldhanekaa / Java Library List.md
Last active November 5, 2020 21:44
Java Library

Library Date : Link

Doc : Link


Scanner :

import java.util.Scanner;
@Aldhanekaa
Aldhanekaa / my first redux app.js
Created October 25, 2020 00:27
First Redux app
const INCREMENT = 'INCREMENT', // Define a constant for increment action types
DECREMENT = 'DECREMENT', // Define a constant for decrement action types
MULTIPLY = 'MULTIPLY',
DIVIDE = 'DIVIDE';
const counterReducer = (state= 0, action) => {
switch(action.type) {
case INCREMENT :
return state + 1
const squareList = (arr) => {
// Only change code below this line
if (Array.isArray(arr)) { // check if the arr is an arrat
console.log('hello world')
arr = arr.filter(element => typeof parseInt(element) == 'number')
.filter(element => element > 0 && element.toString().indexOf('.') == -1)
.map(element => element ** 2);
console.log(arr)
return arr;
}else
// The global variable
var watchList = [
{
"Title": "Inception",
"Year": "2010",
"Rated": "PG-13",
"Released": "16 Jul 2010",
"Runtime": "148 min",
"Genre": "Action, Adventure, Crime",
"Director": "Christopher Nolan",
// tabs is an array of titles of each site open within the window
var Window = function(tabs) {
this.tabs = tabs; // We keep a record of the array inside the object
};
// When you join two windows into one window
Window.prototype.join = function (otherWindow) {
this.tabs = this.tabs.concat(otherWindow.tabs);
return this;
};
@Aldhanekaa
Aldhanekaa / Understand the Hazards of Using Imperative Code.js
Last active October 14, 2020 23:30
Functional Programming: Understand the Hazards of Using Imperative Code : Using my solution
// tabs is an array of titles of each site open within the window
var Window = function(tabs) {
this.tabs = tabs; // We keep a record of the array inside the object
};
// When you join two windows into one window
Window.prototype.join = function (otherWindow) {
console.log(this.tabs)
this.tabs = this.tabs.concat(otherWindow.tabs);
return this;
function getIndexToIns(arr, num) {
let result;
if (arr.indexOf(num) == -1) {
let N = Math.min(...arr.filter(e => e > num));
console.log(N);
N = arr.indexOf(N)
console.log(N)
result = N;
// console.log(arr.indexOf(r))
}else {