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 / stats.js
Last active June 8, 2018 03:08 — forked from ItzMeDwii/stats.js
const Discord = require("discord.js")
const moment = require('moment');
const _fs = require("fs");
const packages = JSON.parse(_fs.readFileSync('./package.json', 'utf-8'));
require('moment-duration-format');
const os = require('os');
let cpu = os.cpus();
exports.run = (client, message, args, tools) => {
const duration = moment.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
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("+================+================+==========+");
@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>
@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 / 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 / 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 / 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 / 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 / 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 / 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)
}