The gist aims to show settings needed to run mongo
in a docker
container.
Along with essential files come files needed to reproduce the case.
# shellcheck shell=bash | |
## | |
# serialize_array | |
# Serializes a bash array to a string, with a configurable seperator. | |
# | |
# $1 = source varname ( contains array to be serialized ) | |
# $2 = target varname ( will contian the serialized string ) | |
# $3 = seperator ( optional, defaults to $'\x01' ) | |
# |
Without either MONGO_INITDB_ROOT_USERNAME
, or MONGO_INITDB_ROOT_PASSWORD
the access is unrestricted.
docker-compose.yml
:
version: '3'
services:
mongo:
image: mongo:4
More recent resolution: | |
1. cd ~/../../etc (go to etc folder in WSL). | |
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
5. cd ~/../../etc (go to etc folder in WSL). | |
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
secondary. |
from locust import HttpLocust, TaskSet, task | |
import json | |
class UserBehavior(TaskSet): | |
def on_start(self): | |
# this retrieves a coookie from the server and stores in in a RequestsCookieJar: self.locust.client.cookes | |
# that is, it stores the cookie on an instance of this class, not the class itself (as your code does) | |
# your server may have different requirements for how the login request should look, but this worked for me | |
self.client.post("/login", |
Below is a common error when trying to setup CI/CD using fastlane or raw XcodeBuild/Xcrun command | |
"error: exportArchive: No "iOS In House" profiles for team" or error: exportArchive: No "adhoc In House" profiles for team | |
Fixing it : | |
1) Easiest way is to make a build archive in Xcode, Export using organizer and Saving it in a folder. | |
2) Go to the folder, open Export Options.plist and replicate the same in Fastlane - build_app or gym - export options | |
3) In case of XcodeBuild - Replace the same in Export Options.plist which is provided in XCodeBuild command and try again | |
4) Make a build, thank me . |
##################### | |
# | |
# Use this with or without the .gitattributes snippet with this Gist | |
# create a fixle.sh file, paste this in and run it. | |
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
# This Gist normalizes handling by forcing everything to use Unix style. | |
##################### | |
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
import * as React from 'react'; | |
import * as hash from 'object-hash'; | |
import { | |
TableProps, | |
Table, | |
TableBody, | |
TableCell, | |
TableFooter, | |
TableHeaderCell, |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu