PUT /_all/_settings
{
"index.search.slowlog.threshold.query.warn": "10s",
"index.search.slowlog.threshold.query.info": "5s",
"index.search.slowlog.threshold.query.debug": "2s",
This file contains 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
/* | |
Java Age counting | |
In the Java file, write a program to perform a GET request on the route: | |
https://coderbyte.com/api/challenges/json/age-counting | |
Which contains a data key and the value is a string which contains items in the format: | |
key=STRING, age=INTEGER |
This file contains 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
/** | |
* EXAMPLE: [ONBOARDING]Someone has just signed up! | |
**/ | |
const https = require('https'); | |
const zlib = require('zlib'); | |
exports.handler = (event, context, callback) => { | |
const options = { | |
hostname: "hooks.slack.com", |
This file contains 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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains 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
/** | |
* Perf calculation between two environments (beta/stable) using Postman exported data | |
* JSON schema: | |
* { | |
* "environmentName": [ | |
* exportedResultObject | |
* ] | |
* } | |
* | |
* E.g |
This file contains 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
from narkdown.exporter import NotionExporter | |
if __name__ == "__main__": | |
token_v2 = "you can take this token opening the browser's page inspector, going to page storage and take token_v2 from the notion cookies" | |
page_url = "https://www.notion.so/company_name/link" | |
notion_exporter = NotionExporter(token_v2) | |
notion_exporter.get_notion_page(page_url) |
This file contains 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
SELECT | |
* | |
FROM table | |
WHERE EXTRACT(ISODOW FROM created_at) IN (6, 7); |
This file contains 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
#!/usr/bin/node | |
const folderPath = "dist", | |
nodeMajorVersion = process.version.match(/\d+/g)[0], | |
hasMajorVersionGreatherThanOrEqual = (aVersion) => | |
nodeMajorVersion >= aVersion, | |
successMessage = () => console.log("Dist fold deleted!"), | |
removeFolder = (path) => { | |
const fs = require("fs"); |
This file contains 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
""" | |
Sheets module improves the productivity when dealing with spreadsheets | |
""" | |
def detect_complex_types(_row): | |
return [index for (index, row) in enumerate(_row) if type(_row) is dict] | |
def map_complex_types_into_string(_values): |
This file contains 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
""" | |
GAPI Sheets module improves the Gapi sheets usage | |
Turn on the credentials in your account: | |
https://developers.google.com/sheets/api/quickstart/python | |
Put the redirect uri as http://localhost:9999/ | |
""" |
NewerOlder