Skip to content

Instantly share code, notes, and snippets.

View faddah's full-sized avatar

Faddah Wolf faddah

View GitHub Profile
@faddah
faddah / gist:4ec8443a05341f7c23414979569c96c4
Created October 5, 2024 21:35
Fly.io Error Log in Deploying Astro app via GitHub Actions
#15 0.894 ▶ Astro collects anonymous usage data.
#15 0.894 This information helps us improve Astro.
#15 0.894 Run "astro telemetry disable" to opt-out.
#15 0.894 https://astro.build/telemetry
#15 0.894
#15 2.391 21:25:27 [types] Generated 406ms
#15 2.400 21:25:27 [check] Getting diagnostics for Astro files in /app...
#15 6.809 src/actions/index.ts:40:21 - warning ts(6133): 'input' is declared but its value is never read.
#15 6.809
#15 6.809 40 orThrow: function (input: FormData): Promise<SafeResult<{ id: number; text: string; good: boolean; }, string>> {
@faddah
faddah / src-actions-index.ts
Created October 3, 2024 02:18
Faddah's current src-actions-index.ts & src-pages-ideas.astro from the Astro Party course
import { defineAction, type SafeResult } from "astro:actions";
import { db, Idea } from "astro:db";
import { z } from "astro:content";
interface IdeaInput {
id: number;
text: string;
good: boolean;
}
@faddah
faddah / decorator-example.ts
Created August 8, 2024 17:13
Example of creating a Decorator in TypeScript
function Logger(logString: string) {
console.log('LOGGER FACTORY');
return function (constructor: Function) {
console.log(logString);
console.log(constructor);
};
}
@Logger(`LOGGING - PERSON...`)
class anotherPerson {
@faddah
faddah / main.py
Created June 10, 2024 21:55
Faddah's python code is not working
# import sys
# print('Number of Mintues in 20 Days:', 20 * 60 * 24)
calculate_days_to_seconds = 60 * 60 * 24
name_of_units = 'seconds'
def days_to_units(num_of_days):
return print(f"{num_of_days} Days are {num_of_days * calculate_days_to_seconds} {name_of_units}. ")
@faddah
faddah / HousingInfo.test.jsx
Created June 6, 2024 00:11
Faddah's code for HousingInfo.test.jsx ± error result
it('clears all input fields when you click the clear button', async () => {
const user = userEvent.setup();
const mockClear = vi.fn();
const address = {
lastPermanentStreet: '20th ave',
lastPermanentCity: 'Portland',
lastPermanentState: 'Oregon',
lastPermanentZIP: '97205',
monthsHomeless: '1 Month',
timesHomeless: 'One Time',
@faddah
faddah / gist:efb099e0b3690b30f518b4dbbe1af1bd
Created May 3, 2024 22:49
Errors from starting up & trying to log-in PASS
client.ts:18 [vite] connecting...
15:45:35.744 client.ts:150 [vite] connected.
15:45:36.029 AppRoutes.jsx:58 Warning: A props object containing a "key" prop is being spread into JSX:
let props = {key: someKey, path: ..., label: ..., element: ...};
<Route {...props} />
React keys must be passed directly to JSX without using spread:
let props = {path: ..., label: ..., element: ...};
<Route key={someKey} {...props} />
at AppRoutes (http://192.168.12.238:5173/src/AppRoutes.jsx:36:23)
at main
@faddah
faddah / DOM-Cardio-partial.js
Last active March 17, 2021 01:40
Faddah's Playing Card solution from Wes Bos' DOM-Cardio.js
// create a function called generatePlayerCard that takes in three arguments: name, age, and height
const generatePlayerCard = (name, age, height) => `
<div class="player-card">
<h2>${name} — ${age}</h2>
<p>Their height is ${height} and they are ${age} years old. In Dog years this person would be ${
age * 7
}. That would be a tall dog!</p>
<button onClick={this.closest('.player-card').remove()} class="card-delete-button" type="button">&times; Delete</button>
<style>
@faddah
faddah / index.js
Created August 1, 2020 18:12
String Compare Coding Challenge question
function missingWords(s, t) {
// split each string into an Array and have a result Array
const sArr = s.split(" ");
const tArr = t.split(" ");
let missingResult = [];
// compare the strings using a loop, pushing missing words into final missingResult Array
for (let i = 0; i < sArr.length; i++) {
if (!tArr.find(el => el === sArr[i])) {
missingResult.push(sArr[i]);
@faddah
faddah / FizzBuzz.js
Last active July 22, 2020 18:39
JavaScript FizzBuzz example
'use strict';
/*
* Complete the 'fizzBuzz' function below.
*
* The function accepts INTEGER n as parameter.
*/
function fizzBuzz(n) {
if(typeof n !== 'number') {
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()