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
from aocd import get_data | |
inp=get_data(day=1, year=2023) | |
lines=inp.splitlines() | |
def collectNumberWords(line): | |
numberPairs = { "one" : 1, "two" : 2, "three" : 3, "four": 4, "five": 5, "six": 6, "seven": 7, "eight": 8, "nine": 9 } | |
indexNumberList = [] | |
for x in numbers: | |
if x in line: | |
lastIndex = line.rindex(x) |
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
/* | |
You are given an m x n matrix of characters box representing a side-view of a box. Each cell of the box is one of the following: | |
A stone '#' | |
A stationary obstacle '*' | |
Empty '.' | |
The box is rotated 90 degrees clockwise, causing some of the stones to fall due to gravity. Each stone falls down until it lands on an obstacle, another stone, or the bottom of the box. Gravity does not affect the obstacles' positions, and the inertia from the box's rotation does not affect the stones' horizontal positions. | |
It is guaranteed that each stone in box rests on an obstacle, another stone, or the bottom of the box. |
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 layout = require('@architect/shared/layout') | |
const arc = require('@architect/functions') | |
exports.handler = arc.http.async(handler) | |
// @ts-ignore | |
async function handler(req) { | |
const isLoggedIn = !!req.session.email | |
if(isLoggedIn) { |
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
{ | |
"New tape test": { | |
"scope": "javascript,typescript", | |
"prefix": "tttest", | |
"body": [ | |
"test('$1', (t) => {", | |
"\t$0", | |
"\tt.end()", | |
"})" | |
] |
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
Show hidden characters
{ | |
"include": [ | |
"src/**/*.js", | |
"test/**/*.js" | |
], | |
"compilerOptions": { | |
/* Basic Options */ | |
"target": "ES2017", | |
"lib": ["ESNext.Array"], | |
"module": "commonjs", |
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
// Copy and paste it into Chrome devtools console to run it | |
let cliParser = (args) => { | |
let keyValueList = [] | |
let keyBucket = [] | |
let valueBucket = [] | |
let isKey = false | |
let isInsideQuote = false | |
args += '-' //to add last key value pair | |
args.split('').forEach(x =>{ | |
// console.log('Processing', x) |
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
sudo yum update -y && \ | |
sudo yum remove awscli -y && \ | |
sudo rm /usr/local/bin/sam && \ | |
sudo rm -rf /usr/local/aws-sam-cli | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ | |
unzip awscliv2.zip && \ | |
sudo ./aws/install && \ | |
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip && \ | |
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation && \ | |
sudo ./sam-installation/install && \ |
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
This template.yaml file | |
# snip | |
- StepFunctionsExecutionPolicy: # Manually change to StartSyncExection after deployment | |
StateMachineName: | |
!Ref ProcessImageStateMachineExpressSync | |
# snip | |
generates this role |
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
openapi: "3.0.1" | |
info: | |
title: "Api for processImage step func" | |
version: "2020-11-06 15:32:29UTC" | |
paths: | |
/: | |
post: | |
responses: | |
default: | |
description: "Default response for POST /" |
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
<html> | |
<body> | |
<button type="submit" onclick="submit();">Submit</button> | |
</body> | |
<script> | |
function submit(){ | |
fetch("<api_url>", { |
NewerOlder