I hereby claim:
- I am manc on github.
- I am nicksg (https://keybase.io/nicksg) on keybase.
- I have a public key ASC4ucCFuzV10dRfWB4sQ02pGC4vl9OuSbve8tIfaOb9AAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * Filter array of mixed type elements narrowing down the resulting types, | |
| * e.g. from `string | null` to just `string`. | |
| */ | |
| const mixedArray: Array<string|null> = ['a', 'b', null, '']; | |
| const strings: string[] = mixedArray | |
| .filter( | |
| (value): value is string => typeof value === 'string' | |
| ); |
| const { spawnSync } = require('child_process'); | |
| const options = { | |
| awsCliBinary: '/usr/local/bin/aws', | |
| awsProfileSource: 'profile1', | |
| awsRegionSource: 'eu-west-1', | |
| awsTableSource: 'table1', | |
| awsProfileTarget: 'profile2', | |
| awsRegionTarget: 'eu-west-2', | |
| awsTableTarget: 'table2', |
| export CLICOLOR=1 | |
| export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd | |
| # Gulp and Bower CLI without installing them globally | |
| alias gulp="./node_modules/.bin/gulp" | |
| alias bower="./node_modules/.bin/bower" |
| [Unit] | |
| Description=Consul service discovery agent | |
| Requires=network-online.target | |
| After=network.target | |
| [Service] | |
| User=consul | |
| Group=consul | |
| PIDFile=/run/consul/consul.pid | |
| Restart=on-failure |
| [MongoDB] | |
| name=MongoDB Repository | |
| baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86_64/ | |
| gpgcheck=0 | |
| enabled=1 |
| #!/bin/bash | |
| # ------------------------------------------------------------------------------ | |
| # This script will generate a new private key and a Certificate Signing Request | |
| # (CSR) using OpenSSL. | |
| # This script is non-interactive. Instead it uses the variables set at the | |
| # beginning of this script. Alternatively you can adapt this script easily | |
| # to read the values differently as required. | |
| # Developed and tested on Mac OS only, but should work on Linux too. | |
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. | |
| # |
| /** | |
| * Convert a URL or just the query part of a URL to an | |
| * object with all keys and values. | |
| * Usage examples: | |
| * // Get "GET" parameters from current request as object: | |
| * var parameters = parseQueryString(window.location.search); | |
| */ | |
| function parseQueryString(query) { | |
| var obj = {}, | |
| qPos = query.indexOf("?"), |
| /** | |
| * Disallow line breaks in textareas. Line breaks are converted to | |
| * a space character or any other replacement. | |
| * Usage examples: | |
| * // Convert line breaks only once to spaces (default): | |
| * $('textarea').nolinebreaks(); | |
| * | |
| * // Convert line breaks only once to something else: | |
| * $('textarea').nolinebreaks(' / '); | |
| * |