Skip to content

Instantly share code, notes, and snippets.

View sunjayaali's full-sized avatar

Ali Sunjaya sunjayaali

  • Jakarta, Indonesia
View GitHub Profile
@sunjayaali
sunjayaali / primes.js
Last active November 10, 2018 16:25
Prime Numbers
function isPrime(n) {
for (let i = 2; i <= Math.sqrt(n); i++) {
if (n % i === 0) {
return false;
}
}
return true;
}
@sunjayaali
sunjayaali / http-download.go
Created May 20, 2019 18:06
Example to read a file and send it to browser with Go.
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"path/filepath"
@sunjayaali
sunjayaali / installing-postman.md
Last active September 18, 2019 07:09 — forked from ba11b0y/installing-postman.md
Installing Postman on Ubuntu

Tested on 18.04. Download postman from https://dl.pstmn.io/download/latest/linux

Installing Postman

tar -xzf Postman-linux-<VERSION>.tar.gz

If any version is installed before, remove it.

sudo rm -rf /opt/Postman
@sunjayaali
sunjayaali / main.go
Created July 7, 2021 08:27
Go append slice speed comparison
package main
import (
"fmt"
"strconv"
"sync"
"time"
)
func method(f func()) func() {