My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
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
const headerNums = new Array("139","138","137","136","135","134","159","158","157","150","151","152","188","187","182","183","184","178","130","131","132","156","155","186","185","176","133","153","189","180","181","177"); | |
const headerNum = headerNums[parseInt(Math.random() * 10 ,10)] | |
const bodyNum = Math.random().toString().replace('0.', '').slice(0, 8) | |
console.log(headerNum + bodyNum) |
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: http://hanxue-it.blogspot.com/2018/08/macos-homebrew-installing-older-version-of-software.html - just created a copy to keep it for long term] | |
Homebrew always wants to install the latest version of the Formula (software). This is by design, because every time there is an update to a formula, it wants to be tested against all the other formulas that it depends on. Mixing new and old versions of software is a recipe for incompatibility disaster. | |
But sometimes there are situations where you need an older version of software. In my specific case, Yarn was compiled against an older version of icu4c, and I want that older version instead of recompiling Yarn. | |
$ yarn install | |
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib | |
Referenced from: /usr/local/bin/node |
This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
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
# On slow systems, checking the cached .zcompdump file to see if it must be | |
# regenerated adds a noticable delay to zsh startup. This little hack restricts | |
# it to once a day. It should be pasted into your own completion file. | |
# | |
# The globbing is a little complicated here: | |
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct. | |
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error) | |
# - '.' matches "regular files" | |
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours. | |
autoload -Uz compinit |
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
#!/bin/bash | |
# This scripts scans the elasticsearch source code for all the registered REST endpoints | |
# It will put the formatted output in $DEFINITIONOUTPUTFILE | |
# [MethodName] [HttpVerb] [Route] | |
ESFOLDER="../elasticsearch" | |
DEFINITIONOUTPUTFILE="src/Generated/rest-actions.txt" | |
# Find all the lines that registerHandlers |