Skip to content

Instantly share code, notes, and snippets.

View ikr4-m's full-sized avatar
😁
I'm here!

Ikramullah Latif ikr4-m

😁
I'm here!
View GitHub Profile
@ikr4-m
ikr4-m / install.sh
Created June 25, 2022 10:04
Hyper-V Enhanced Session for Debian
#!/bin/sh
# This script based on linux-vm-tools for Ubuntu 22.02.
# Thanks to https://github.com/Hinara/linux-vm-tools/ to script
# This script is for Ubuntu 22.04 Jammy Jellyfish to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
#
@ikr4-m
ikr4-m / ReactSimpleDestroyComponent.js
Created July 28, 2020 13:08
Seperti judul filenya
import React, { useState } from 'react'
import Overlay from './Overlay'
function App () {
const [showOverlay, setOverlay] = useState(false)
function triggerOverlay (event) {
event.preventDefault()
showOverlay ? setOverlay(false) : setOverlay(true)
}
@ikr4-m
ikr4-m / TelegrafSimpleExample.js
Created July 22, 2020 13:28
Simple Example for Telegraf API
const { Telegraf } = require('telegraf')
const Markup = require('telegraf/markup')
const BaseScene = require('telegraf/scenes/base')
const WizardScene = require('telegraf/scenes/wizard')
const Stage = require('telegraf/stage')
const session = require('telegraf/session')
require('dotenv/config')
require('console-stamp')(console)
@ikr4-m
ikr4-m / jsdoc-props-state-react.jsx
Created February 9, 2020 05:29
How to make JSDoc for React Component
import React, { Component } from 'react'
/**
* @typedef Props - Test typedef props
* @property {boolean} [mantap] - Mantap ga?
*
* @typedef State - Test typedef state
* @property {number} itung - Angka
*
* @extends {Component<Props, State>}
@ikr4-m
ikr4-m / kotak-tengah.html
Created October 28, 2019 10:45
Kasi tengah kotak
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Kotak Tengah</title>
<style>
@ikr4-m
ikr4-m / duitRupiah.js
Created September 19, 2019 13:42
Ubah tampilan uangmu dalam bentuk JS
/**
* Diambil dari https://www.malasngoding.com/membuat-format-rupiah-dengan-javascript/
* Dimodifikasi sendiri oleh saya, Ikramullah Latif @github/skymunn
*/
/**
* Uang menjadi fixed
* @param {string} angka Harus string karena ada fungsi String.replace masalahnya
* @param {string} prefix Prefix uang, kosongkan kalau mau tetap rupiah
*/
@ikr4-m
ikr4-m / getErrorMessage.js
Created June 22, 2019 07:21
Get JSON file in CI_RESTful_Error_Exception
/**
* @param {string} err
*/
let getErrorMessage = (err) => {
// All json string will pass in this regex
let regex = /(\{\"([^\"]+)\"\:(\w+)\,\"([^\"]+)\"\:\"([^\"]+)\"\,\"([^\"]+)\"\:\"([^\"]+)\"\})/gm
return JSON.parse(err.match(regex)[0]);
}
@ikr4-m
ikr4-m / main.js
Created December 5, 2018 14:33
bot-kontol-example
/**
* Pseudo Random Number Generator with No Repeat
* @copyright 2018 github/lingkaryamediaformasi
*/
/** Array kosakatanya */
var kosakata = [
"mantan", "pacar", "kamu", "saya", "dia", "penjahat", "pesawat", "lampu", "tiang",
"masak", "panci", "piring", "anjing", "kucing", "buku", "botol", "galon", "muka"
];
@ikr4-m
ikr4-m / index.html
Created December 5, 2018 14:32
bot-kontol-example
<!DOCTYPE html>
<html>
<body>
<script src="./main.js"></script>
</body>
</html>
package latihanpbo;
import java.util.Scanner;
public class Penjualan {
public static void main(String[] args) {
// inisialisasi Scanner untuk mendeksi inputan
Scanner in = new Scanner(System.in);
// membuat Menu Interface
System.out.println("+================+================+==========+");