Skip to content

Instantly share code, notes, and snippets.

View peteretelej's full-sized avatar
:octocat:
💻

Peter Etelej peteretelej

:octocat:
💻
View GitHub Profile
@peteretelej
peteretelej / Add-Old-Repo-Github.md
Last active April 30, 2025 21:33
Add old code project to github with correct timestamps

How to add an Old Project to GitHub While Retaining Timestamps for old changes

This guide will help you create a new Git repository from an existing project while preserving the original file modification timestamps. This way, your commit history will reflect the chronological changes made to the project.

Follow these steps: (needs bash & git)

Steps

1. Initialize the Repository

@peteretelej
peteretelej / obsidian-fix-pasted-images.go
Created June 4, 2024 10:27
Fix Obsidian Pasted Image Locations - update to attachments folder
// Cleanup old Obsidian Pasted Image links
// Finds all images and moves them to an `attachments/` folder in the same directory as the markdown linking it
// and then deletes the old images.
package main
import (
"bytes"
"fmt"
"log"
"os"
@peteretelej
peteretelej / plex-file-rename-script.sh
Last active May 14, 2023 20:43
Fix TV Show Episode Names for Plex
#!/bin/bash
#
# Usage (in bash prompt)
# ./plex_file_renamer.sh [directory]
# If no directory is provided, the script will run on the
# current directory. Otherwise, it will run on the specified
# directory, processing all subdirectories recursively.
#
# This script renames TV show episode files to match
# the preferred Plex naming convention. It supports several
@peteretelej
peteretelej / proxy.go
Created July 3, 2019 12:55
A simple reverse-proxy in Go that enables CORS
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
@peteretelej
peteretelej / followers.go
Created December 17, 2017 06:07
github followers / following
package main
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"github.com/google/go-github/github"
@peteretelej
peteretelej / iq_quiz_sample.txt
Last active November 30, 2017 04:51
sample aiken iq
Q1. If Bob sold 15 apples in a working week, what is the average number of apples he sells each day?
A) 2
B) 3
C) 5
D) 2.14
ANSWER: B
Q2. "Pig is to pork" as "Cow is to _____":
A) Lamb
B) Cattle

Keybase proof

I hereby claim:

  • I am peteretelej on github.
  • I am peteretelej (https://keybase.io/peteretelej) on keybase.
  • I have a public key ASD5wVIkRLYCFWkR5wx8bjpLmiCFjREm9PD5BxCbSdJjiQo

To claim this, I am signing this object:

package main
import (
"fmt"
"log"
"sync"
"time"
)
func main() {
@peteretelej
peteretelej / unfollowers.go
Last active November 5, 2017 10:59
find twitter unfollowers
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"strings"
)
@peteretelej
peteretelej / gitcommitmessage
Last active August 29, 2015 14:06
Git Commit Message Proper Format
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the present tense: "Fix bug" and not "Fixed