Skip to content

Instantly share code, notes, and snippets.

View gifff's full-sized avatar

Gifary Dhimas Fadhillah gifff

View GitHub Profile
@gifff
gifff / gpg-utils.js
Last active February 14, 2021 05:06
const { exec } = require("child_process");
async function checkGPGPrivateKeyImported(keyName, strict = false) {
const HAS_NO_SECRET_KEY_STRING = "No secret key";
return new Promise((resolve, reject) => {
const proc = exec(`gpg -K ${keyName}`);
let hasKeyNameInStdout = false;
let hasNoSecretKeyInStderr = false;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package compfest;
import java.util.Scanner;
/**
@gifff
gifff / multi-interfaces-extends.java
Created June 11, 2017 05:13
multi-interfaces-extends
interface A { void a(); };
interface B { void b(); };
interface C extends A, B {
void c();
void d();
};
class Test implements C {
@Override
@gifff
gifff / gist:4e4c0a4c4499061854e2f4b09e501176
Created June 11, 2017 05:12
multi-extends-interfaces.java
interface A { void a(); };
interface B { void b(); };
interface C extends A, B {
void c();
void d();
};
class Test implements C {
@Override
@gifff
gifff / KalkulatorString.java
Created December 22, 2016 02:11
Soal Challange No.3
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package javaapplication3;
import java.util.Scanner;
//import java.util.Arrays;
//import java.util.ArrayList;
@gifff
gifff / BarangDanHarga.java
Created December 21, 2016 10:38
Soal Challange no 2 Pemrograman Dasar - 21 Desember 2016
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package javaapplication3;
import java.util.Scanner;
/**
@gifff
gifff / ElementAB.java
Created December 1, 2016 14:15
Simply check whether all elements in array A exist in array B and vice versa. Also show the differences, if any.
//import java.util.Scanner;
/**
*
* @author GifaryDhimas
*/
public class ElementAB {
public static void main(String[] args) {
/*
Scanner sc = new Scanner(System.in);
@gifff
gifff / TransposeMatriks.java
Last active November 23, 2016 02:40
Matrix Transposition coded in java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package PD_Array;
import java.util.Scanner;
/**
@gifff
gifff / PerkalianMatriks.java
Created November 23, 2016 02:36
Two Matrix Multiplication source code in java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package PD_Array;
import java.util.Scanner;
/**
*
@gifff
gifff / NewClass.java
Created November 17, 2016 04:09
A simple sum of two 2-dimension Java array
import java.util.Scanner;
/**
*
* @author GifaryDhimas
*/
public class NewClass {
public static void main(String[] args) {
int a[][] = {{1,2,3},{1,2,3}},
b[][] = {{1,2,3},{1,2,3}},