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
| const os = require("os"); | |
| //Create function to get CPU information | |
| function cpuAverage() { | |
| //Initialise sum of idle and time of cores and fetch CPU info | |
| var totalIdle = 0, totalTick = 0; | |
| var cpus = os.cpus(); | |
| //Loop through CPU cores |
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
| version: '2' | |
| services: | |
| mongodb: | |
| image: mongo:3 | |
| volumes: | |
| - /data/graylog/mongo_data:/data/db | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:6.8.2 | |
| volumes: | |
| - /data/graylog/es_data:/usr/share/elasticsearch/data:rw |
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
| [user] | |
| name = gpiazzolla | |
| email = [email protected] | |
| [alias] | |
| search = ! git branch -a | sed '/->/d' | sed 's/\\*//' | xargs git grep -n -I | |
| hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
| last = log -1 head | |
| rehard = reset --hard | |
| branches = branch -la |
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
| import java.io.File; | |
| import java.nio.file.Path; | |
| import java.nio.file.Paths; | |
| import java.util.Arrays; | |
| import java.util.HashSet; | |
| import java.util.List; | |
| import java.util.Set; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.StreamSupport; |
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
| { | |
| "request": { | |
| "method": "GET", | |
| "url": "http://www.softwareishard.com/blog/har-12-spec/", | |
| "httpVersion": "HTTP/1.1", | |
| "headers": [ ], | |
| "cookies": [ ] | |
| }, | |
| "response": { | |
| "status": 200, |
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
| CREATE SCHEMA library | |
| AUTHORIZATION postgres; | |
| CREATE SEQUENCE library.books_book_id_seq | |
| INCREMENT 1 | |
| START 1 | |
| MINVALUE 1 | |
| MAXVALUE 2147483647 | |
| CACHE 1; | |
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
| @echo off | |
| @setlocal | |
| set start=%time% | |
| :: Runs your command | |
| cmd /c %* | |
| set end=%time% | |
| set options="tokens=1-4 delims=:.," |
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
| import java.time.LocalDate; | |
| public class Easter{ | |
| public static void main(String []args){ | |
| System.out.println(HelloWorld.getEasterOfYear(2021)); | |
| } | |
| private static LocalDate getEasterOfYear(int 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
| const calculus = require('./calculus') | |
| const asynch_calculus = (num) => { | |
| return new Promise((resolve, reject) => { | |
| resolve(calculus.execute(num)) | |
| }) | |
| } |
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
| const execute = (num) => { | |
| let result = 0; | |
| for (let i = Math.pow(num, 7); i >= 0; i--) { | |
| result += Math.atan(i) * Math.tan(i); | |
| } | |
| return result; | |
| } | |
| module.exports = { | |
| execute |
OlderNewer