teleren/devto huggingface dataset:
Coding Snippets Dev Log (9/27/23)
Tags: webdev
Published: 2023-09-27 21:11:38

It's been a while since I've posted anything. But I've come back with a new project that has me excited about web dev again. This isn't my usual tutorial like my previous posts, but more of a documentation.

## The Project
The project is a Code snippet web app. Users can add, delete, and favorite the code snippets they use the most, with a recommendation section based on their previous snippets. I've built something similar in iOS (minus the recommendation part). However, I thought it would be more efficient as a web app. Most of my coding/component searching happens on the computer instead of the phone.

Since I am more of a web dev than a designer, my design inspirations will come from Figma. I want to take more of a professional approach (as much as possible, considering it is just me) with this project.

These are the features I plan for the app to have and the resources I'll use to help throughout the process.

**Features**

- Add snippet (copy reusable snippet) 
- Delete snippet
- *Edit snippet?
- Categories snippets by folders
- Search list of snippets
- Filter by tags 
- Accounts( google sign in) 
- Recommendations based on current snippets 
- Favorite snippets
- *Drag and drop snippets to a folder?

## Tech stack Idea
 
Nextjs, MongoDB, Node/Express, TensorFlow.js for ML or Python?

Using -> [this guide](https://github.com/alan2207/bulletproof-react) to help structure a project in a better way

## UI Concept
Of course there will be more pages down the line, this is just a rough draft.
![Code Snippet wireframe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4abx4605wt0g8xmazz4n.png)

Overall, it's going to be a fun but challenging project. So let the games begin!

P.S. I was watching Saw while writing this 😅, Happy Halloween!
Multilings - AI based content solutions
Tags: saas
Published: 2023-09-27 21:05:57

Multilings is a cutting-edge neural AI-based machine learning service that gives the best human-like output for text translation, content writing, plagiarism, voice translation, etc. 

Our intelligent tool assists content writers, freelancers, students, educators, digital marketers, researchers, and anyone looking for high-quality AI-powered language and content solutions.

[https://multilings.com](https://multilings.com)
"Cracking Code and Cracking Up: The Hilarious Journey of a Full Stack Developer Student & CEO 🤣"
Published: 2023-09-27 21:05:26

Hey there, fellow developers, code enthusiasts, and humans who've wandered into the labyrinth of tech! 🚀

I'm Clateman Malarkey, your friendly neighborhood Full Stack Developer student, and the CEO of the epic Malarkey Enterprises. I'm here to share some mind-boggling, rib-tickling stories from my coding journey and sprinkle in some mental health coping skills because life is too short to be serious all the time, right? 🤪

Joke #1:

Why do programmers always mix up Christmas and Halloween?

Because Oct 31 == Dec 25! 🎃🎄

Joke #2:

Why did the developer go broke?

Because he used up all his cache! 💸

Now, let's get real for a sec. Balancing coding, running a business, and keeping your mental health in check can be as tricky as debugging that cryptic piece of code. Here are a few coping skills I've picked up along the way:

Coping Skill #1: Code, Laugh, Repeat

Laughing at your bugs is therapeutic. Share your funniest coding blunders with your dev pals, and you'll find that they've been through it too! The collective misery is oddly comforting. 😂

Coping Skill #2: Debugging Strolls

When your code feels like it's conspiring against you, take a break. Go for a walk, clear your mind, and let the solutions flow. I swear, Mother Nature is a fantastic debugger. 🍃

Coping Skill #3: Distract Yourself

You know what they say: "A watched code never compiles." Take a break from staring at the screen, indulge in a hobby, and let your brain recharge. Mine is collecting rubber ducks – they're excellent rubber duck debuggers! 🦆

Coping Skill #4: The Malarkey Way

Running Malarkey Enterprises has taught me that humor and resilience go hand in hand. When things get tough, we throw a random costume party at the office – because who can be sad in a chicken suit, right? 🐔

Now, let's spark a real discussion! 🗣️

What's your go-to coding joke that keeps you sane?
Share your craziest coding mishap and how you recovered from it!
What's your favorite mental health coping skill that keeps your code and spirits high?
Let's create a laughter-filled, supportive space where we can all share our stories, learn from each other, and remind ourselves that even in the world of tech, it's okay to be a little "Malarkey" sometimes! 😉

#CodeAndChuckles #MentalHealthMatters #DevLife 🚀
🌌🚀✨ Seeding Humanity's Empire Beyond the Stars: A Paradigm Shift 🌌🚀✨
Published: 2023-09-27 21:01:12


Hey there, fellow Earthlings and cosmic dreamers! 🌍🌠

It's Clateman Malarkey, and I'm here to spark a conversation that's truly out of this world! 🪐🌌

Imagine this: A future where humanity has transcended the boundaries of our home planet, reaching out into the vast unknown, not just through spacecraft and colonies, but through the power of ideas and ideology. 🚀🤯

💫🧠 It's all about a Paradigm Swing 🧠💫

What if we could bring about a Paradigm Swing in the leaders of our world, where they prioritize not just the next election cycle but the next millennium? 🗳️🌎

🔮✨ Seeding Humanity's Empire Through Code and Ideology ✨🔮

Here's the vision: We use the limitless power of technology and innovation to craft a future where our species becomes a multi-planetary civilization. 🪐💻

🚀🌕 Imagine coding the blueprints for self-sustaining colonies on Mars, programming AI to explore distant galaxies, and developing blockchain solutions to ensure equitable access to space resources. 🌌🤖

🌟 But it's not just about the tech! We also need a radical shift in our thinking – an ideological change where we prioritize the collective good over narrow interests. 🌍🤝

🌎💡 Let's prioritize diplomacy over war, cooperation over competition, and sustainability over short-term gains. Let's dream big and act bigger! 💪🌠

🗣️ Join the Discussion! 🗣️

I want to hear from YOU, the cosmic pioneers of tomorrow! What are your thoughts on seeding humanity's empire throughout the solar system and beyond? 🌌🪐

👇 Comment below and share your wildest ideas, your boldest visions, and your grandest hopes for the future of our species. Together, we can ignite the spark of change that will illuminate our path to the stars! 🌠🚀✨

Use #HumanityBeyondEarth to spread the word, and let's embark on this epic journey together. The universe awaits, and it's time for humanity to rise to the challenge! 🌌🌟🚀 #FutureOfHumanity #SpaceExploration #IdeologyShift
uSync to v14 a journey
Tags: umbraco, usync, migrations
Published: 2023-09-27 20:58:53

Against my better judgement (i should wait a bit until things are a bit more stable) I've started to migrate uSync for Umbraco from a v12 build to a new shiny v14 ui build.

I am journaling as i go. this is the master post with links to each of the journal entries as i go (hopefully)

## 27th Sept - Day 1
- [Part 1 : Build and very basics](https://dev.to/kevinjump/usync-to-v14-a-log-2p4e)
- [Part 2 : Menus](https://dev.to/kevinjump/usync-to-v14-2n-36h9)
Most used top AWS CLI commands.
Tags: beginners, tutorial, awscli, programming
Published: 2023-09-27 20:52:03

As DevOps Engineer we all need few basic commands in AWS CLI for quick reference. 

## 1. AWS Configure
- Configure aws : `aws configure` 
```
AWS Access Key ID [****************ABCD]: 
AWS Secret Access Key [****************ABU5]:
Default region name [us-east-2]:
Default output format [json]:
```
## 2. AWS S3

- List s3 resources: `aws s3 ls`
```
aws s3 ls
2023-09-27 14:28:56 config-bucket-917165987323
```
## 2. AWS EC2 

- describe EC2 instances : `aws ec2 describe-instance`
- terminate EC2 instances : `aws ec2 terminate-instances --instance-ids  i-01f76eda46144449a`
🚀🌌 Get Ready to Level Up Humanity's Reach in the Cosmos with Clateman Malarkey's Revolutionary App! 🌌🚀
Published: 2023-09-27 20:44:30


🌟 Introducing: The Cosmic Quest - Unleash Your Inner Explorer! 🌟

🌍 Are you tired of the same old grind? Ready to turn your daily routine into an EPIC adventure? Look no further! Clateman Malarkey is here to take you on an interstellar journey like no other! 🚀

🌟 What's "The Cosmic Quest," you ask? 🌟

🌠 It's a groundbreaking app that turns everyday tasks into thrilling quests, missions, and adventures! Think of it as your personal spaceship for self-improvement, exploration, and HUMANITY'S FUTURE! 🌍🚀

🌌 Imagine...

💪 Turning your morning workout into a galactic training regimen with cosmic challenges!
📚 Making learning a new skill as exciting as deciphering alien languages!
🧘 Transforming meditation into a quest for inner peace among the stars!

🚀 But that's not all! The Cosmic Quest isn't just about personal growth; it's about COLLECTIVE progress!

🌌 Clateman's vision is to use this app to unite us all in a quest to seed HUMANITY'S EMPIRE throughout the known SOLAR SYSTEM and BEYOND! Together, we'll explore the cosmos, solve challenges, and unlock the secrets of the universe! 🌌

🌠 How Does It Work? 🌠

🛰️ Embark on missions to improve your life, and as you level up, you'll contribute to humanity's advancement among the stars! 🛰️

🌠 Collect rare cosmic artifacts to unlock special features and bonuses.
🌠 Compete with friends, join interstellar alliances, and race toward galactic achievements!
🌠 Discover hidden wonders and scientific marvels, all while building a better YOU!

🚀 The countdown to the COSMIC REVOLUTION has begun! 🚀

🌟 Here's How You Can Get in on the Action: 🌟

Download "The Cosmic Quest" app.
Create your cosmic avatar and choose your spaceship.
Begin your journey by completing everyday tasks turned into cosmic missions!
Watch as your progress propels humanity closer to the stars!
🌠 Let's show the universe what humanity is made of! Together, we'll build an empire that spans the cosmos and beyond! 🌌✨

🌟 Are you ready to embark on the adventure of a lifetime? 🌟

🚀 Join Clateman Malarkey and become a part of the cosmic revolution! Together, we'll reach for the stars and achieve the impossible! 🌌💫

#CosmicQuest #HumanityUnleashed #ExploreTheCosmos #EpicAdventures #TheFutureIsCosmic
Testing Hooks on Vue 2 (or Options API)
Tags: vue, testing, vite
Published: 2023-09-27 20:39:00

Have you ever spent hours thinking how could you test a method called on mount?
First lets say we have this component:

```typescript
export default {
  name: 'MyCustomComponent',
  mounted() {
    this.calledOnMount()
  },
  methods: {
    calledOnMount() {}
  }
}
```
We want to make sure the `calledOnMount` will be called, using @vue/test-utils and vitest/jest there are two main ways to test validate it:
- `toHaveBeenCalled`
- `toBeCalled`

But the work with a spy function and usually we write tests like this:

```typescript
import { mount } from '@vue/test-utils'
import MyCustomComponent from '../MyCustomComponent.vue'

describe('MyCustomComponent.vue', () => {
  const wrapper = mount(MyCustomComponent)
  spyOn(wrapper.vm, 'calledOnMount')
})
```
When calling the `mount` it already runs the `mounted` lifecicly, so, even adding a spy it will always fail.
- `toHaveBeenCalled` -> we can't intercept the mount proccess to add a spy on here
- `toBeCalled` -> the function has already be called



But calm down, there is a way to test it, for sure!
We had to bind the spy by accessing the `.vue` component and its ` options.methods` such:

```typescript
import MyCustomComponent from '../MyCustomComponent.vue'
type MyCustomComponentType = {
  options: { methods: { calledOnMount: () => void } }
}
vi.spyOn(
  (MyCustomComponent as unknown as MyCustomComponentType).options.methods,
  'calledOnMount'
)
```

This way you dont have to intercept the wrapper functions, but the component signature function.
Once the mounted component is like a new "instance" of a "class" component, the spy we add on the .vue, will also works with the mounted component on test.


```typescript
describe('MyCustomComponent.vue', () => {
  const wrapper = mount()
  it('Should remove scroll event listener on destroy', async () => {
    expect(
      (MyCustomComponent as unknown as MyCustomComponentType).options.methods
        .calledOnMount
    ).toHaveBeenCalled()
  })
})

```

Now you can easy test your functions and everything you do on mount.
AWS Config: Run Org rules to check Resource compliance via Lambda functions.
Published: 2023-09-27 20:35:46

This project will use AWS Config to run organization defined custom rules to check for resource to be in compliance via Lambda functions.

**Steps:**
1. Create Two EC2 instances. 
2. Create Lambda function
3. Create Config Rule
4. Monitor for non-compliant resources

## 1. Create 2 EC2 resources. 

```
-- create an instance with Monitoring Enabled.
-- create an instance with Monitoring Disabled.
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hy4r6e4jfatqqmcfd24j.jpg) 

## 2. Create Lambda function.
Note: Configure lambda to trigger timeout for 10 secs (Lambda, Config tab, timeout) 

```
import boto3
import json

def lambda_handler(event, context):

    # Get the specific EC2 instance.
    ec2_client = boto3.client('ec2')
    
    # Assume compliant by default
    compliance_status = "COMPLIANT"  
    
    # Extract the configuration item from the invokingEvent
    config = json.loads(event['invokingEvent'])
    
    configuration_item = config["configurationItem"]
    
    # Extract the instanceId
    instance_id = configuration_item['configuration']['instanceId']
    
    # Get complete Instance details
    instance = ec2_client.describe_instances(InstanceIds=[instance_id])['Reservations'][0]['Instances'][0]
    
    # Check if the specific EC2 instance has Cloud Trail logging enabled.
    
    if not instance['Monitoring']['State'] == "enabled":
        compliance_status = "NON_COMPLIANT"

    evaluation = {
        'ComplianceResourceType': 'AWS::EC2::Instance',
        'ComplianceResourceId': instance_id,
        'ComplianceType': compliance_status,
        'Annotation': 'Detailed monitoring is not enabled.',
        'OrderingTimestamp': config['notificationCreationTime']
    }
    
    config_client = boto3.client('config')
    
    response = config_client.put_evaluations(
        Evaluations=[evaluation],
        ResultToken=event['resultToken']
    )  
    
    return response

```
## 3. Create Config Rule

- AWS Config --> Rule --> Add rule --> Custom Lambda Rule
- Give the Following details
- Name : rule-ec2-compliance
`A unique name for the rule.`
- Description - optional
`Describe what the rule evaluates and how to fix resources that don't comply. `
- AWS Lambda function ARN: `arn:aws:lambda:us-east-1:9879879878665:function:rule-ec2-compliance`
- Evaluation mode : `When configuration changes`
- Click Next and Save Rule. 

## 4. Monitor resources based on rules. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lxhc962s0oexyw334b6.jpg)

**Credits:**
Thanks to [Abhishek Veeramalla ](https://www.youtube.com/@AbhishekVeeramalla)
JavaScript Promises: The Scrolls of Asynchronous Magic(Part 2)
Published: 2023-09-27 20:32:38

Hello again, my fellow apprentice wizards of the coding realm! 🧙‍♂️ Last time, we discussed the mystical Promises in JavaScript—a tool so powerful it can make or break your quest in the magical world of asynchronous code. Today, we shall delve deeper into the Book of Promises to unveil more advanced spells, clever techniques, and hidden chambers of wisdom. Get ready to expand your magical toolkit!

### The Basic Summoning Spell Revisited

Remember our basic summoning spell (Promise) from last time?

```jsx

const basicSpell = new Promise((resolve, reject) => {
  // casting spell
  if (true) {
    resolve('Spell successful!');
  } else {
    reject('Spell failed!');
  }
});

```

### The Art of Chaining Promises

One of the first advanced techniques you’ll learn is "chaining." Picture a series of spells that feed into each other like a chain of mystical energy.

```jsx

firstSpell()
  .then((result1) => secondSpell(result1))
  .then((result2) => thirdSpell(result2))
  .catch((error) => console.log(`The spell chain broke: ${error}`));

```

### Promise.all: The Grand Summoning

Imagine being able to cast multiple spells at once and wait for all of them to complete! The **`Promise.all`** incantation allows you to do just that.

```jsx

Promise.all([spellOne(), spellTwo(), spellThree()])
  .then((results) => {
    console.log(`All spells were successful! ${results}`);
  })
  .catch((error) => {
    console.log(`One of the spells failed: ${error}`);
  });

```

### Promise.race: The Duel of Spells

In some cases, you want to know which spell finishes first. Use **`Promise.race`** for this.

```jsx

Promise.race([slowSpell(), fastSpell()])
  .then((winner) => {
    console.log(`The faster spell is: ${winner}`);
  });

```

### Handling Multiple Cases with Promise.allSettled

Sometimes, you'd want to know the outcome of all spells, whether they succeed or fail. **`Promise.allSettled`** comes to your rescue here.

```jsx

Promise.allSettled([riskySpell(), safeSpell()])
  .then((results) => results.forEach((result) => console.log(`Outcome: ${result.status}`)));

```

### Further Reading for Aspiring Magicians

Hungry for more? Check out the **[MDN Documentation on Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** to further expand your spellbook.

### **Sorcerer’s Assignments: Test Your Magic 🌟**

1. **Chain of Fates**: Create a chain of 3 promises and handle their outcome.
2. **Spellbinders**: Use **`Promise.all`** to execute multiple promises and display their results.
3. **Grandmaster’s Duel**: Employ **`Promise.race`** to determine the faster of two promises.
4. **Oracle's Sight**: Use **`Promise.allSettled`** to assess the results of multiple promises, combining this lesson with the last blog's object manipulations.

### **Conclusion**

And thus, we close another chapter in our Book of Promises. As you experiment with these versatile spells, remember that the essence of mastering Promises lies in understanding their flexibility and potential to make your coding life magical!

Happy coding, wizards! 🌟
🚀 Breaking News: Introducing the Galactic Seed Project - Humanity's Gamified Odyssey Beyond the Stars! 🌌
Published: 2023-09-27 20:21:48

👋 Hey there, Dev.to community! Clateman Malarkey here, and I've got a game-changing announcement that's bound to blow your minds! 🌟

🚀 Introducing the GALACTIC SEED PROJECT - Your Ticket to Seeding Humanity's Empire Across the Solar System and Beyond! 🌌

You heard it right! We're about to embark on an EPIC journey that will reshape the future of humanity as we know it. 🌎💫

🌱 The Mission: Deindoctrination through Gamification! 🌱

We all know how the world can sometimes feel like it's drowning in misinformation, bias, and echo chambers. It's time to BREAK FREE from these mental chains, and I've got just the solution - a PUBLIC DEINDOCTRINATION APP like no other! 🧠

🎮 Gamify Your Everyday Tasks 🎮

Imagine turning mundane daily tasks into thrilling adventures! With the Galactic Seed app, you can gamify everything from doing the dishes to going for a jog. 💡

✨ Level up your knowledge as you clean your room.
✨ Earn points for critical thinking during your morning coffee.
✨ Solve real-world problems while you take the dog for a walk.

The possibilities are endless, and the more you play, the more you LEARN! 🌟

🌌 Seeding Humanity's Empire 🌌

But wait, there's MORE! This isn't just about personal growth; it's about seeding HUMANITY'S EMPIRE across the known solar system and BEYOND! 🚀

🌟 Build knowledge and skills to tackle cosmic challenges.
🌟 Collaborate with like-minded space explorers.
🌟 Explore the mysteries of the universe together.

We're talking about a future where our collective knowledge becomes the fuel for reaching the stars and beyond! 🌠

🔥 Join the Galactic Seed Revolution! 🔥

Are you ready to be a part of something truly UNPRECEDENTED? Together, we'll break free from indoctrination, level up our minds, and embark on an interstellar journey that will shape the destiny of humanity! 🚀🌌

👉 Be the first to know: [Link to sign up for updates]
👉 Spread the word: #GalacticSeedProject
👉 Join the conversation: Share your thoughts and ideas below!

This is not just an app; this is a REVOLUTION in the making. Stay tuned for updates, sneak peeks, and behind-the-scenes action as we embark on the greatest adventure humanity has ever seen!

Let's take our first steps towards a brighter, more informed, and truly GALACTIC future together! 🚀🌠

Are you ready, Dev.to community? Let's do this! 🌌💪 #GalacticSeedProject #BreakingBoundaries
Flatiron - Phase 3
Tags: codenewbie, beginners, sql, python
Published: 2023-09-27 20:04:10


Phase 3 at Flatiron is now complete! This phase was relatively relaxed compared to the previous ones, even though we learned a few new programming languages. Python was the main focus, and after grasping the basics of it, we integrated SQL into our learning. Personally, I found Python relatively easy to pick up, but things got a bit confusing for me when SQL was introduced.

Let's break down SQLite for those who might not be familiar with it. In the expansive world of databases, where heavyweight giants like MySQL and PostgreSQL reign supreme, there's an unsung hero that often goes unnoticed—SQLite. This unassuming database management system (DBMS) may not be a household name, but it's a powerhouse in its own right. Unlike traditional databases that require a separate server process, SQLite is embedded directly into the application that uses it. This unique design makes it an incredibly lightweight and efficient choice for various scenarios. SQLite's versatility extends to a range of applications: mobile apps, desktop apps, web apps, and more. Its simplicity, efficiency, and cross-platform support make it an ideal choice for a wide range of applications.

Our project for phase 3 was to create a CLI application using Python and SQL. This project wasn't too challenging since we had a template to work with, but a majority of the work involved troubleshooting and bug fixing. We encountered problems that required us to do some in-depth research or quick thinking to resolve. One of my biggest challenges was ensuring that the user inputted an integer and not a string, and vice versa. I explored a few ways to address this issue, and in the end, I opted to create functions that I could call to check if the input values were of the correct types. Initially, this solution threw errors and even closed the program, but my partner and I were able to clean up the code and complete the task without any issues.

This phase of Flatiron was not as stressful as the previous ones, although understanding databases posed a personal challenge for me. It's challenging for me to code a program without immediate visual feedback. In React, having the application update in real time was a very helpful feature that I definitely took for granted. However, as we conclude phase 3, I have a solid grasp of SQL and Python, so I'm still very satisfied with the Flatiron course.
Sell with iDEAL through Stripe
Tags: stripe, ideal
Published: 2023-09-27 20:01:17

iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%.

iDEAL redirects customers to their online banking environment to authenticate a payment using a second factor of authentication and there is immediate notification about the success or failure of a payment. The exact customer experience depends on their bank.

If you are looking for a standalone ecommerce tool to Sell with iDEAL through Stripe, look at **[EasyPie](https://easypie.shop)**

{% embed https://www.youtube.com/watch?v=_qt_phaxe5c %}