Skip to content

Instantly share code, notes, and snippets.

View ekopradesga's full-sized avatar

Eko Prasetyo ekopradesga

View GitHub Profile
@ekopradesga
ekopradesga / gradle.build
Last active April 8, 2018 09:24
Gradle Build Files For Spring, Hibernate, Postgresql And Tomcat In Java Website Development
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a commented-out sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.1/userguide/tutorial_java_projects.html
*/
buildscript {
repositories {
@ekopradesga
ekopradesga / CheckPairEndSum.java
Last active January 29, 2019 04:30
tantangan phpid for student telegram
import java.util.*;
public class CheckPairEndSum {
public static void main(String args[]) {
if (args != null) {
for (String d : args) System.out.println(d);
}
if (args == null) {
System.out.println("return false 1");
@ekopradesga
ekopradesga / Derivative.java
Last active February 18, 2020 01:34
Quiz PHPID
public class Derivative {
private static String calculate(int n) {
if (n <= 1) return "";
StringBuilder res = new StringBuilder();
res.append(recX(n - 1, false));
res.append(recDX(n - 2));
return res.toString();
}
private static String recX(int n, boolean decrease) {
@ekopradesga
ekopradesga / meeting.csv
Last active April 13, 2020 03:47
Meeting Online Compare
App Max. Participant Stable Connection Overlay Video Screen Share Save Attend Log Save Chat Log Password Attendee Rate
Gsuite Meet 150 7 No yes yes yes yes 153
Zoom 300 7 No yes yes yes yes 303
Skype Bussinees 2000 8 No yes yes yes yes 20008
@ekopradesga
ekopradesga / searchjson.dart
Last active January 19, 2022 10:11
Search JSON
import 'dart:convert';
void main() {
String jsonStr = '[{"asset":"BTC","free":0,"locked":0},{"asset":"LTC","free":0,"locked":0},{"asset":"ETH","free":0,"locked":0},{"asset":"NEO","free":0,"locked":0},{"asset":"BNB","free":0.75884444,"locked":0},{"asset":"QTUM","free":0,"locked":0},{"asset":"EOS","free":0,"locked":0},{"asset":"SNT","free":0,"locked":0},{"asset":"BNT","free":0,"locked":0},{"asset":"GAS","free":0,"locked":0},{"asset":"BCC","free":0,"locked":0},{"asset":"USDT","free":1633.6586226,"locked":0},{"asset":"HSR","free":0,"locked":0},{"asset":"OAX","free":0,"locked":0},{"asset":"DNT","free":0,"locked":0},{"asset":"MCO","free":0,"locked":0},{"asset":"ICN","free":0,"locked":0},{"asset":"ZRX","free":0,"locked":0},{"asset":"OMG","free":0,"locked":0}]';
List<Map<String, dynamic>> data = jsonDecode(jsonStr);
Map<String, dynamic> dt = data.firstWhere((dat) => dat['asset'] == 'USDT');
print(dt['free']);
}
@ekopradesga
ekopradesga / qrcam.js
Created May 13, 2022 09:49
QR camera
const video = document.createElement("video"),
canvasElement = document.getElementById("qr-canvas"),
canvas = canvasElement.getContext("2d"),
outputData = document.getElementById("docqrcode"),
btnScanQR = document.getElementById("take-camera");
let scanning = !1;
function tick() {
canvasElement.height = video.videoHeight, canvasElement.width = video.videoWidth, canvas.drawImage(video, 0, 0, canvasElement.width, canvasElement.height), scanning && requestAnimationFrame(tick)
}