Skip to content

Instantly share code, notes, and snippets.

View tetsupanda's full-sized avatar
🐢

Justin Garrett tetsupanda

🐢
  • Indianapolis, IN
View GitHub Profile
@tetsupanda
tetsupanda / setAwsCreds.js
Last active August 25, 2020 14:51
Node script that updates the credentials file, in the case you are using the AWS SDK and AWS CLI behind AWS SSO.
//Using encode, parse from 'ini' lib, probably not needed *shrugs*
async function setAWSCredentials () {
const userProfilePath = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME']
const awsCacheFile = '/.aws/cli/cache'
const awsCredentialFile = '/.aws/credentials'
const cachefullPath = userProfilePath + awsCacheFile
const credsFullPath = userProfilePath + awsCredentialFile
from http.client import HTTPSConnection
from html.parser import HTMLParser
class MYHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
if tag == 'a':
for name, value in attrs:
if name == "href":
print(name, "=", value)
import unittest
def solution(T):
seasons = ('WINTER', 'SPRING', 'SUMMER', 'AUTUMN')
season_len = len(T) // 4
last_highest = 0
highest_season = 0
for i in range(4):
import unittest
def solution(N, S, T):
start_ord = ord('A')
s_arr = S.split(',')
t_arr = T.split(' ')
ships = []