Add these snippets to vscode yaml snippets to quickly add preconfigured snippets for .pre-commit-config.yaml pre-commit config.
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
| if !has('nvim') | |
| " Auto install vim-plug | |
| if empty(glob('~/.vim/autoload/plug.vim')) | |
| silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
| \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
| endif | |
| endif | |
| if has('nvim') |
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 json | |
| import MySQLdb | |
| import os | |
| import requests | |
| def handler(event, context): | |
| if event['RequestType'] == 'Create' or event['RequestType'] == 'Update': | |
| parameters = event['ResourceProperties'] | |
| create_db( |
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
| # Adapted from https://stackoverflow.com/questions/35869985/datetime-datetime-is-not-json-serializable | |
| import datetime | |
| import json | |
| import boto3 | |
| def datetime_handler(x): | |
| if isinstance(x, datetime.datetime): | |
| return x.isoformat() |
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
| #!/usr/bin/env python3 | |
| # Usage | |
| ''' | |
| python convert_csv_to_rewrite_map.py file.csv > rewrite_map.txt | |
| ''' | |
| import csv | |
| import sys | |
| from urllib.parse import urlparse |
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
| var subnetIds:String[] = []; | |
| vpc.privateSubnets.forEach((value: ISubnet)=>{ | |
| subnetIds.push(value.subnetId) | |
| }); | |
| const template = new cfninc.CfnInclude(this, "Template", { | |
| templateFile: 'template.yaml', | |
| parameters: { | |
| "ClusterName": cluster.clusterName, | |
| "Subnets": cdk.Fn.split(",", subnetIds.join(",")), |
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
| [credential] | |
| helper = !aws codecommit credential-helper $@ | |
| UseHttpPath = true |
OlderNewer