ssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
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 csv | |
| import json | |
| import argparse | |
| def convert_csv_to_json(input_file, output_file, verbose=False): | |
| print(f"Converting {input_file} >>> {output_file}") | |
| output_dict = { "rows": [], "sourceFile": input_file } |
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
| #!/bin/sh | |
| # Generic AWS ECR authentication script | |
| REGION=us-east-1 | |
| ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account) | |
| aws ecr get-login-password --region $REGION \ | |
| | docker login \ | |
| --username AWS \ | |
| --password-stdin $ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com |
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
| # coding: utf-8 | |
| def merge_dict(dict1, dict2): | |
| res = {**dict1, **dict2} | |
| return res |
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
| --- | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: >- | |
| Creates EC2 instance with an IAM role that can access an S3 Bucket (also created). | |
| Parameters: | |
| KeyPairName: | |
| Description: EC2 Instance SSH Key | |
| Type: AWS::EC2::KeyPair::KeyName |
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
| navigator.serviceWorker.getRegistrations().then(registrations => registrations.map(k => k.unregister())); |
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
| # coding: utf-8 | |
| '''Excel Column Conversion, (C) 2018 Adam C. Abernathy, Lic. MIT''' | |
| def excel_alpha_to_index(column_name, alphabet='abcdefghijklmnopqrstuvwxyz'): | |
| return sum([(alphabet.find(column_name[-i - 1].lower()) + 1) * pow(len(alphabet), i) | |
| for i in reversed(xrange(len(column_name)))]) | |
| def excel_index_to_alpha(postion, alphabet='abcdefghijklmnopqrstuvwxyz'): | |
| column_name = '' | |
| while postion > 0: |
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
| '''Simple CLI arguments parser | |
| Requires the `--key=value` format. Defaults to True if value is omitted. | |
| (C) 2018 Adam C. Abernathy, adamabernathy@gmail.com | |
| ''' | |
| import sys | |
| def coerce_value(value=None): |
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
| // A bit cleaner now | |
| let keepRunning = true; | |
| for (let i = 0, li = 5; keepRunning && i < li; i++) { | |
| for (let j = 0, lj = 5; keepRunning && j < lj; j++) { | |
| for (let k = 0, lk = 5; keepRunning && k < lk; k++) { | |
| if (k == 3) { | |
| keepRunning = false; | |
| break; | |
| } | |
| for (let m = 0, lm = 5; m < lm; m++) { |
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
| 'use strict'; | |
| // The basic idea | |
| let keepRunning = true; | |
| for (let i = 0, li = 5; i < li; i++) { | |
| if (!keepRunning) break; | |
| for (let j = 0, lj = 5; j < lj; j++) { | |
| if (!keepRunning) break; | |
| for (let k = 0, lk = 5; k < lk; k++) { |
NewerOlder