Skip to content

Instantly share code, notes, and snippets.

View novalagung's full-sized avatar
🏠

Noval Agung Prayogo novalagung

🏠
View GitHub Profile

Keybase proof

I hereby claim:

  • I am novalagung on github.
  • I am novalagung (https://keybase.io/novalagung) on keybase.
  • I have a public key whose fingerprint is 6B3B A7C9 6566 2EF0 FFBF 566D 90F4 405F F0FE 1DD5

To claim this, I am signing this object:

transpile es6 into es5 using babel cli.

first install required packages globally.

npm install -g @babel/core @babel/node @babel/preset-env @babel/cli

then use command below to perform transpilation.

package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@novalagung
novalagung / goth
Last active November 23, 2023 07:15 — forked from ammario/goth
golang test coverage html
#!/bin/bash
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
@novalagung
novalagung / linux-command-cheatsheet.md
Last active November 1, 2023 16:45
Linux command cheatsheet, for beginner

Linux command cheatsheet, for beginner

Get executable location of running process by PID

# sudo readlink -f /proc/{PID}/exe
$ sudo readlink -f /proc/479/exe

/tmp/go-build499480868/command-line-arguments/_obj/exe/main
// mengunakan library stdio,
// agar bisa memanfaatkan fungsi standar i/o (input output)
// salah duanya seperti fungsi scanf() dan printf()
#include "stdio.h"
// fungsi utama (main) menggunakan tipe data int,
// dikarenakan beberapa IDE secara "strict" meminta
// fungsi main harus memiliki nilai balik (return value).
int main() {
@novalagung
novalagung / go-soap-wsdl-using-http.go
Last active April 20, 2023 19:16
Example implementation of making SOAP call on WSDL web service using go with only net/http package. The full tutorial avaiable on https://medium.com/eaciit-engineering/soap-wsdl-request-in-go-language-3861cfb5949e
package main
import (
"bytes"
"crypto/tls"
"encoding/base64"
"encoding/xml"
"fmt"
"log"
"net/http"
@novalagung
novalagung / uitextview-dynamic-height-with-autolayout-enabled.md
Last active December 16, 2021 02:21
make UITextView height dynamically follow it's content even with Auto Layout enabled

The key to make text view height follow it's content is by NOT SET HEIGHT CONSTRAINT and DISABLE THE SCROLL.

theTextView.isScrollEnabled = false
theTextView.text = "some text"
theTextView.sizeToFit()

But, if you already set the height constraint, then make it inactive

@novalagung
novalagung / AllGattCharacteristics.java
Created May 21, 2021 14:34 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
# install development dependencies
yum groupinstall -y 'Development Tools'
yum install -y curl git
# install go toolchain
export GOROOT_BOOTSTRAP=/usr/local/go1.4
curl -O https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz
tar -zxf go1.4.3.linux-amd64.tar.gz && mv go ${GOROOT_BOOTSTRAP}
# obtain go source code