Skip to content

Instantly share code, notes, and snippets.

View polyglotdev's full-sized avatar
🔮
Focusing

Dom Hallan polyglotdev

🔮
Focusing
View GitHub Profile
@polyglotdev
polyglotdev / AWS Error during the tutorial
Created September 7, 2024 18:54
AWS Error for Support
4:45:05 PM | CREATE_FAILED | AWS::CloudFormation::Stack | PartitioningStackN...ckResourceEE21A7DB
Embedded stack arn:aws:cloudformation:us-west-2:844077369820:stack/AmazonConnectDataAnalyticsSampleBackend-PartitioningStackNestedStackPartitioningStackN-6LL8UQD53WXV/6ca7b0e0-6d38-11ef-8fb9-0241490f74bd was not successfully created: The following resource(s) failed to create: [A
thenaResultsS3bucketAccessLogsDA26D92E].
:x: AmazonConnectDataAnalyticsSampleBackend failed: Error: The stack named AmazonConnectDataAnalyticsSampleBackend failed to deploy: CREATE_FAILED (The following resource(s) failed to create: [PartitioningStackNestedStackPartitioningStackNestedStackResourceEE21A7DB]. )
at FullCloudFormationDeployment.monitorDeployment (/home/ubuntu/amazon-connect-data-analytics-sample/cdk-stacks/node_modules/aws-cdk/lib/index.js:426:10236)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.deployStack2 [as deployStack] (/home/ubuntu/amazon-connect-data-analyt
@polyglotdev
polyglotdev / custom-vscode.css
Created August 13, 2024 19:50
Custom CSS for VSCode
.mtk3 {
font-family: Operator Mono Lig;
color: #00ffff;
}
.part.sidebar {
box-shadow: 0px 0px 50px rgba(0, 0, 0, 0.25);
}
.line-numbers {
@polyglotdev
polyglotdev / main.go
Created May 25, 2024 20:45
Pulumi for EC2 instance
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
@polyglotdev
polyglotdev / models.go
Created April 22, 2024 18:34
How do we know that the return type was what it is?
func GetEventByID(id int64) (*Event, error) {
query := `SELECT * FROM events WHERE id = ?`
row := db.DB.QueryRow(query, id)
var event Event
err := row.Scan(&event.ID, &event.Name, &event.Description, &event.Location, &event.DateTime, &event.UserID)
if err != nil {
return nil, err
}
return &event, nil
@polyglotdev
polyglotdev / dynamic_reducer.py
Last active January 3, 2023 18:21
`dynamic_reducer` takes a list integers and an operator and does maths on list to sum integers.
def dynamic_reducer(numbers, operator):
result = numbers[0]
for i in range(1, len(numbers)):
if operator == "+":
result += numbers[i]
elif operator == "-":
result -= numbers[i]
elif operator == "*":
result *= numbers[i]
elif operator == "/":
@polyglotdev
polyglotdev / hook-flow.js
Created September 24, 2021 21:16
shows how Hooks flow in React
// Hook flow
// https://github.com/donavon/hook-flow
// http://localhost:3000/isolated/examples/hook-flow.js
// PLEASE NOTE: there was a subtle change in the order of cleanup functions
// getting called in React 17:
// https://github.com/kentcdodds/react-hooks/issues/90
import * as React from 'react'
@polyglotdev
polyglotdev / longest_word.rb
Created September 22, 2021 18:37
longest word
# frozen_string_literal: true
def longest_word(sentence)
split_sentence = sentence.split
my_longest_word = split_sentence.max_by { |word| word.size }
same_length_words = split_sentence.select { |word| word.size == my_longest_word.size }
if same_length_words.empty?
my_longest_word
else
same_length_words.last
@polyglotdev
polyglotdev / dom-uses.md
Last active November 23, 2021 22:40
Software/Hardware that I use
@polyglotdev
polyglotdev / App.js
Created April 1, 2021 18:23
axios call to api
import './App.css'
import withListLoading from './components/withListLoading'
import List from './components/List'
import React, { useEffect, useState } from 'react'
function App() {
const ListLoading = withListLoading(List)
const [appState, setAppState] = useState({
loading: false,
@polyglotdev
polyglotdev / homebrew-fix.md
Created November 20, 2020 01:20
Homebrew Extension Issue

Homebrew Extension Issue

After installing the Big Sir 11.0 update I attempted to install graphviz to use with a tool that will map dependecies in node.js projects. The output looked like this:

❯ brew install graphviz                  
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 4 taps (hashicorp/tap, homebrew/cask-versions, homebrew/core and homebrew/cask).
==> New Formulae
libbsd