Skip to content

Instantly share code, notes, and snippets.

View alfenfebral's full-sized avatar
🎯
Focusing

Alfen Febral alfenfebral

🎯
Focusing
View GitHub Profile
@alfenfebral
alfenfebral / app.js
Created March 5, 2021 14:25
Elastic Search Node Tutorial
const express = require("express")
const bodyParser = require("body-parser")
const elasticsearch = require("elasticsearch")
const app = express()
app.use(bodyParser.json())
app.listen(process.env.PORT || 3000, () => {
console.log("connected")
})
@alfenfebral
alfenfebral / elasticsearch.yml
Created February 27, 2021 11:43
Elastic Search Tutorial Config
discovery.type: single-node
network.host: 0.0.0.0
cluster.routing.allocation.disk.threshold_enabled: false
@alfenfebral
alfenfebral / docker-compose.yml
Created February 27, 2021 11:41
Elastic Search Tutorial Config
# Specified the docker-compose version
version: "3.3"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
volumes:
- ./docker_config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
healthcheck:
test: ["CMD", "curl", "-s", "-f", "http://localhost:9200/_cat/health"]
@alfenfebral
alfenfebral / install-proto3.sh
Created February 20, 2021 19:10
Install Proto 3.15.1
#! /bin/bash
# Make sure you grab the latest version
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.1/protoc-3.15.1-linux-x86_64.zip
# Unzip
unzip protoc-3.15.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
@alfenfebral
alfenfebral / monev.js
Created May 21, 2019 07:16
Buat braiyen
const mongoose = require('mongoose');
const Schema = new mongoose.Schema(
{
teamName: {
type: String,
},
teamCode: {
type: String,
},
<a href="#" data-toggle="tooltip" data-placement="top" title="Hooray!">Hover</a>
<a href="#" data-toggle="tooltip" data-placement="bottom" title="Hooray!">Hover</a>
<a href="#" data-toggle="tooltip" data-placement="left" title="Hooray!">Hover</a>
<a href="#" data-toggle="tooltip" data-placement="right" title="Hooray!">Hover</a>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<!DOCTYPE html>
<html>
<head>
<title>SweetAlert</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
</head>
<body>
<button onclick="normal()">Normal Alert</button>
<button onclick="sweet()">Sweet Alert</button>
config.allowedContent = true;