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 copyToClipboard = (url: string) => { | |
| document.addEventListener('copy', (e: ClipboardEvent) => { | |
| e.clipboardData.setData('text/plain', url); | |
| e.preventDefault(); | |
| document.removeEventListener('copy'); | |
| }); | |
| document.execCommand('copy'); | |
| }; |
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
| const GUID_REGEX = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/ig; |
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
| const {promisify} = require('util'); | |
| const fs = require('fs'); | |
| const readFileAsync = promisify(fs.readFile); | |
| const filePath = process.argv[2]; | |
| async function main() { | |
| try { | |
| const text = await readFileAsync(filePath, {encoding: 'utf8'}); |
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
| internal static class LinqExtensions | |
| { | |
| public static List<List<T>> Partition<T>(this IEnumerable<T> list, int partitionSize) | |
| { | |
| var i = 0; | |
| var splits = from item in list | |
| group item by i++ / partitionSize into part | |
| select part.ToList(); | |
| return splits.ToList(); | |
| } |
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
| import { ISecurityService } from './security'; | |
| import * as moment from 'moment-timezone'; | |
| const UTC_DATE_PARSE: string = 'YYYY-MM-DD'; | |
| export const DEFAULT_TIMEZONE: string = 'UTC'; | |
| /** | |
| * Provides time zone, date conversion and formatting support | |
| * based on the user's preferences. | |
| */ |
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
| kind: Ingress | |
| apiVersion: extensions/v1beta1 | |
| metadata: | |
| name: redirect-ingress | |
| annotations: | |
| ingress.kubernetes.io/configuration-snippet: | | |
| if ($host ~ ^(.+)\.somedomain\.io$) { | |
| return 301 https://$1.domain.io$request_uri; | |
| } | |
| spec: |
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
| /** | |
| * Regex source: https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address | |
| */ | |
| const EMAIL_REGEX = /[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/g; | |
| /** | |
| * Parse a list of valid emails from the specified text. | |
| * | |
| * @param {String} text The string of email addresses to parse. | |
| * @returns {[{email: String, name: 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 interface IanaTimezone { | |
| group: string; | |
| timezone: string; | |
| label: string; | |
| } | |
| export const IANA_TIMEZONES = [ | |
| // UTC+14:00 | |
| { group: 'UTC+14:00', timezone: 'Pacific/Kiritimati', label: 'Pacific/Kiritimati (+14)' }, | |
| // UTC+13:00 |
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
| /** | |
| * Determines if the the current window is within an iframe | |
| * in a safe cross browser model. | |
| * | |
| * @returns {Boolean} True if in an iframe, else false. | |
| */ | |
| inIframe() { | |
| try { | |
| return window.self !== window.top; | |
| } catch (e) { |
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
| function text_replace() { | |
| case "${OSTYPE}" in | |
| darwin*) PLATFORM="OSX" ;; | |
| linux*) PLATFORM="LINUX" ;; | |
| bsd*) PLATFORM="BSD" ;; | |
| *) PLATFORM="UNKNOWN" ;; | |
| esac | |
| if [[ "${PLATFORM}" == "OSX" || "${PLATFORM}" == "BSD" ]]; then | |
| find artifacts/ -type f -name "*.yml" -exec sed -i "" "s/$1/$2/g" {} + |