<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: seamy</title>
    <description>The latest articles on DEV Community by seamy (@1seamy).</description>
    <link>https://dev.to/1seamy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1329192%2F2e4b5f4b-54e8-4682-a036-484a4b629805.png</url>
      <title>DEV Community: seamy</title>
      <link>https://dev.to/1seamy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/1seamy"/>
    <language>en</language>
    <item>
      <title>How to manage identical files?</title>
      <dc:creator>seamy</dc:creator>
      <pubDate>Wed, 29 May 2024 21:52:28 +0000</pubDate>
      <link>https://dev.to/1seamy/how-to-manage-identical-files-2e2c</link>
      <guid>https://dev.to/1seamy/how-to-manage-identical-files-2e2c</guid>
      <description>&lt;p&gt;An endless cycle. Same files different names, Same files different names, Same files different names.&lt;br&gt;
Thanks to ChatGPT.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "crypto/sha256"
    "encoding/hex"
    "fmt"
    "io"
    "io/ioutil"
    "os"
    "path/filepath"
)

func calculateFileHash(filePath string) (string, error) {
    file, err := os.Open(filePath)
    if err != nil {
        return "", err
    }
    defer file.Close()

    hash := sha256.New()
    if _, err := io.Copy(hash, file); err != nil {
        return "", err
    }

    return hex.EncodeToString(hash.Sum(nil)), nil
}

func findAndRemoveDuplicates(dir1, dir2 string) error {
    files1, err := ioutil.ReadDir(dir1)
    if err != nil {
        return err
    }

    files2, err := ioutil.ReadDir(dir2)
    if err != nil {
        return err
    }

    hashMap := make(map[string]string)

    // Process the first directory
    for _, file := range files1 {
        if !file.IsDir() {
            filePath := filepath.Join(dir1, file.Name())
            fileHash, err := calculateFileHash(filePath)
            if err != nil {
                fmt.Printf("Hash hesaplanamadı: %s, hata: %s\n", filePath, err)
                continue
            }

            if _, found := hashMap[fileHash]; found {
                fmt.Printf("Aynı dosya bulundu, siliniyor: %s\n", filePath)
                if err := os.Remove(filePath); err != nil {
                    fmt.Printf("Dosya silinemedi: %s, hata: %s\n", filePath, err)
                } else {
                    fmt.Printf("Dosya başarıyla silindi: %s\n", filePath)
                }
            } else {
                hashMap[fileHash] = filePath
            }
        }
    }

    // Process the second directory
    for _, file := range files2 {
        if !file.IsDir() {
            filePath := filepath.Join(dir2, file.Name())
            fileHash, err := calculateFileHash(filePath)
            if err != nil {
                fmt.Printf("Hash hesaplanamadı: %s, hata: %s\n", filePath, err)
                continue
            }

            if _, found := hashMap[fileHash]; found {
                fmt.Printf("Aynı dosya bulundu, siliniyor: %s\n", filePath)
                if err := os.Remove(filePath); err != nil {
                    fmt.Printf("Dosya silinemedi: %s, hata: %s\n", filePath, err)
                } else {
                    fmt.Printf("Dosya başarıyla silindi: %s\n", filePath)
                }
            } else {
                hashMap[fileHash] = filePath
            }
        }
    }

    return nil
}

func main() {
    dir1 := "C:\\Users\\Asus Rog\\go\\getfilehash\\dir1"
    dir2 := "C:\\Users\\Asus Rog\\go\\getfilehash\\dir2"
    if err := findAndRemoveDuplicates(dir1, dir2); err != nil {
        fmt.Printf("Hata: %s\n", err)
    } else {
        fmt.Println("Kopya dosyalar silindi.")
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to enable GitHub Actions on your Profile README for a snake-eating contribution graph / Edit_DA_01</title>
      <dc:creator>seamy</dc:creator>
      <pubDate>Mon, 08 Apr 2024 21:24:43 +0000</pubDate>
      <link>https://dev.to/1seamy/how-to-enable-github-actions-on-your-profile-readme-for-a-snake-eating-contribution-graph-editda01-5ghh</link>
      <guid>https://dev.to/1seamy/how-to-enable-github-actions-on-your-profile-readme-for-a-snake-eating-contribution-graph-editda01-5ghh</guid>
      <description>&lt;p&gt;Thanks &lt;strong&gt;Michelle Mannering&lt;/strong&gt; for your (&lt;a href="https://dev.to/mishmanners/how-to-enable-github-actions-on-your-profile-readme-for-a-contribution-graph-4l66"&gt;https://dev.to/mishmanners/how-to-enable-github-actions-on-your-profile-readme-for-a-contribution-graph-4l66&lt;/a&gt;) topic.&lt;/p&gt;

&lt;p&gt;If other users wish to utilize this, kindly modify this topic;&lt;/p&gt;

&lt;p&gt;1-Use this (thanks &lt;strong&gt;Platane&lt;/strong&gt; &lt;a href="https://github.com/Platane"&gt;https://github.com/Platane&lt;/a&gt;) file;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/1SeaMy/1SeaMy/blob/main/.github/workflows/main.yml"&gt;https://github.com/1SeaMy/1SeaMy/blob/main/.github/workflows/main.yml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2-Use this;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;![snake gif](https://github.com/YOUR_USERNAME/YOUR_USERNAME/blob/output/github-contribution-grid-snake-dark.svg)&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
or this&lt;/p&gt;

&lt;p&gt;&lt;code&gt;![snake gif](https://github.com/YOUR_USERNAME/YOUR_USERNAME/blob/output/github-contribution-grid-snake.svg)&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
