Skip to content

Instantly share code, notes, and snippets.

View tarasowski's full-sized avatar
:electron:

Dimitri (Dimi) Tarasowski tarasowski

:electron:
View GitHub Profile
@tarasowski
tarasowski / hover.html
Created December 9, 2024 19:59
text slide hover effect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Slide Hover Effect</title>
<style>
/* Container styling */
.hover-slide {
position: relative;
@tarasowski
tarasowski / function.js
Last active November 27, 2024 11:59
azure functions
const { app } = require('@azure/functions');
app.http('list-todos', {
methods: ['GET', 'POST'],
authLevel: 'anonymous',
handler: async (request, context) => {
context.log(`Http function processed request for url "${request.url}"`);
const name = request.query.get('name') || await request.text() || 'world';
# Principles of Clean Code for Techstarter Projects
0 Consistent Naming Conventions
All function names and variables should be written in English. In Python, use snake_case for naming, while in JavaScript, use camelCase.
1 Consistent Indentation (2 or 4 spaces)
Use 4 spaces for indentation in Python and either 2 or 4 spaces for JavaScript. Pick one and stick with it.
2 Use Meaningful Variable and Function Names
Choose descriptive names for variables, functions, and classes. For example, use "userAge" instead of "x" or "a".
@tarasowski
tarasowski / post-user.js
Created November 8, 2024 09:44
post user js lambda function
import { randomUUID } from 'crypto'
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { PutCommand, DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
const client = new DynamoDBClient({});
const docClient = DynamoDBDocumentClient.from(client);
const TABLE_NAME = "Techstarter"
const addToDB = async (entry) => {
const command = new PutCommand({
@tarasowski
tarasowski / get-users.js
Created November 8, 2024 08:50
dynamodb scan operation
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, ScanCommand } from "@aws-sdk/lib-dynamodb";
const client = new DynamoDBClient({});
const docClient = DynamoDBDocumentClient.from(client);
const TABLE_NAME = "Techstarter"
const scanOperation = async () => {
const command = new ScanCommand({
/* style.css */
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
// script.js
document.addEventListener("DOMContentLoaded", function() {
var character = document.getElementById("character");
var container = document.getElementById("container");
// Aktuelle Position des Charakters
var position = {
left: 0,
top: 0
};
describe('Newsletter Subscribe Form', () => {
beforeEach(() => {
cy.visit('http://localhost:3000')
})
it('allows users to subscribe to the email list', () => {
const email = "[email protected]"
cy.getByData("email-input").type(email)
cy.getByData("submit-button").click()
cy.getByData("success-message").contains(email)
})
@tarasowski
tarasowski / pipeline.yml
Created March 5, 2024 11:51
React app test pipeline
name: Selenium Tests
on:
push
jobs:
test:
runs-on: ubuntu-latest
steps:
@tarasowski
tarasowski / App.css
Created March 5, 2024 11:15
Bulletin board css
.App {
text-align: center;
}
.box {
position: absolute;
cursor: move;
color: black;
background-color: white;
max-width: 215px;