-
abs(float)- Returns the absolute value of a given float. Example:abs(1)returns1, andabs(-1)would also return1, whereasabs(-3.14)would return3.14. See also thesignumfunction. -
basename(path)- Returns the last element of a path. -
base64decode(string)- Given a base64-encoded string, decodes it and returns the original string.
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
| export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`); | |
| export const wsObserver = ws | |
| .pipe( | |
| retryWhen(errors => | |
| errors.pipe( | |
| delay(1000) | |
| ) | |
| ) | |
| ); |
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1
First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):
cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plistMost importantly, note the -D /usr/local/var/postgres argument.
Second, shut down your current PostgreSQL.
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
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
| class Enumerator | |
| def extract(&blk) | |
| self.each do |obj| | |
| blk.call(*blk.parameters.map(&:last).map {|attr| obj.send(attr)}) | |
| end | |
| end | |
| end | |
| Treasure = Struct.new(:coins, :gems) |