Skip to content

Instantly share code, notes, and snippets.

View alfianmalik's full-sized avatar
🎯
Focusing

Alfian Maulana Malik alfianmalik

🎯
Focusing
View GitHub Profile

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@alfianmalik
alfianmalik / README.md
Created November 24, 2020 07:58 — forked from eliquious/README.md
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@alfianmalik
alfianmalik / gpg-encrypt.go
Created November 23, 2020 08:43 — forked from ayubmalik/gpg-encrypt.go
Golang encrypt file using GPG openpgp. Use standard go libs.
package main
/**
Example hack to encrypt a file using a GPG encryption key. Works with GPG v2.x.
The encrypted file e.g. /tmp/data.txt.gpg can then be decrypted using the standard command
gpg /tmp/data.txt.gpg
Assumes you have **created** an encryption key and exported armored version.
You have to read the armored key directly as Go cannot read pubring.kbx (yet).
@alfianmalik
alfianmalik / functions.php
Created June 22, 2020 04:18 — forked from i-like-robots/functions.php
Wordpress custom comment form
<?php
/**
* Comment form hidden fields
*/
function comment_form_hidden_fields()
{
comment_id_fields();
if ( current_user_can( 'unfiltered_html' ) )
{
package people
import "fmt"
type Person struct {
FirstName string
LastName string
Age int
}
package main
func SumProductDiff(i, j int) (int, int, int) {
return i+j, i*j, i-j
}
package people
// Declares a variable of type 'Person'. The internal fields of the p variable
// are set to their zero value i.e. FirstName is an empty string and Age is 0
var p Person
// Instantiate a struct by supplying the value of all the struct fields.
var p = Person{"Joe", "Sweeny", 36}
// Initialize a struct by supplying name: value pairs of all the struct fields.
package people
type Person struct {
FirstName string
FastName string
Age int
}
<?php
class Person
{
/**
* @var string
*/
public $firstName;
/**
* @var string
package errors
import (
"fmt"
)
func printError(err bool, m string) string {
if err {
message = "You have encountered an error"
// Attempting to set 'message' to anything other than a string will result