This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var elasticsearch = require('elasticsearch'); | |
var Promise = require('bluebird'); | |
var log = console.log.bind(console); | |
var client = new elasticsearch.Client({ | |
host: 'localhost:9200', | |
log: 'trace' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#Ask some info | |
echo -n "Enter ELK Server IP or FQDN: " | |
read eip | |
echo -n "Enter Admin Web Password: " | |
read adpwd | |
#Update System | |
sudo apt-get update | |
sudo apt-get upgrade -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"check-coverage": true, | |
"statements": 95, | |
"lines": 95, | |
"functions": 95, | |
"branches": 95, | |
"watermarks": { | |
"statements": [60, 95], | |
"lines": [60, 95], | |
"functions": [60, 95], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Snail Sort | |
snail = (array) => { | |
const result = [] | |
const n = array.length | |
let x = n // column pointer | |
let y = n // row pointer | |
if (n === 1) { | |
return array[0] // single value | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paginator Helper Class | |
class PaginationHelper { | |
constructor(collection, itemsPerPage) { | |
this.collection = collection | |
this.itemsPerPage = itemsPerPage | |
} | |
itemCount() { | |
return this.collection.length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple API REST (NodeJS - Express - MongoDB) | |
const express = require('express') | |
const app = express() | |
const bodyParser = require('body-parser') | |
const mongoose = require('mongoose') | |
const bcrypt = require('bcrypt') | |
const salt = bcrypt.genSaltSync(10) // fixed salt | |
// Tokens Blacklist (a very straightforward alternative to some STS) | |
const revokedTokens = new Set() |