Skip to content

Instantly share code, notes, and snippets.

View DovieW's full-sized avatar

Dovie Weinstock DovieW

View GitHub Profile
@DovieW
DovieW / issues-gitea-to-github.sh
Created November 16, 2023 23:47
Transfer issues from Gitea to Github
#!/bin/bash
# Configuration
GITEA_REPO="username/repository"
GITEA_API_TOKEN="your_gitea_api_token"
GITHUB_REPO="username/repository"
GITHUB_API_TOKEN="your_github_api_token"
GITEA_API_URL="https://your_gitea_instance/api/v1"
GITHUB_API_URL="https://api.github.com"
ISSUE_FILE="gitea_issues.json"
@DovieW
DovieW / send_email.ps1
Created May 11, 2023 02:26
Send Email via PowerShell
$to = "[email protected],[email protected]" # comma separate multiple recipients
$from = "[email protected]"
$subject = "subject goes here"
$body = "message body goes here"
$smtpServer = "smtp.gmail.com"
$smtpClient = New-Object Net.Mail.SmtpClient($smtpServer, 587) # port 25 for non SSL, port 587 for SSL
$smtpClient.EnableSsl = $true # set to $true for SSL
""""""""""""""""""""""
" Leader
""""""""""""""""""""""
" let mapleader=,
" can't set leaders in Obsidian vim, so the key just has to be used consistently.
" However, it needs to be unmapped, to not trigger default behavior: https://github.com/esm7/obsidian-vimrc-support#some-help-with-binding-space-chords-doom-and-spacemacs-fans
unmap ,
" map ; to : in normal mode, so that I don’t rely on the shift key
" nmap ; :
@volkbay
volkbay / fix_git_security_check_termux.md
Last active October 2, 2024 17:51
Disable Git security check on Termux

👾 Error

fatal: detected dubious ownership in repository at '/storage/emulated/0/<some_folder>'
To add an exception for this directory, call:

        git config --global --add safe.directory /storage/emulated/0/<some_folder>

🤔 Why do I see this error ?

This is a simple check (by Git) comparing current user ID and the ID of the owner of the current folder. If they do not match (in case of rootless Termux, root owns them all.), Git will not permit any action (even git status).

@simonv3
simonv3 / podsync.md
Last active February 10, 2025 13:59
Podsync & Pocket Casts

Say you want to listen to youtube videos as a podcast but you're too stubborn to use the AWS instant install thing on the podsync home page.

Before you start: if you're using Pocket Casts you'll want to make sure this all works before adding the podcast. Pocket Casts will cache your podcasts and then if you goofed it will always be referencing the non-working podcast. You can fix that by changing the subdomain you use. But it's just easier if you get it right from the start. You can test that it works by using something like Apple Podcasts, which will not cache and will just work if it works.

I'm kind of expecting that you're comfortable (though not necessarily experienced in) logging into your router, accessing the terminal and doing git commands, managing domain names, and that docker works on your system.

  1. Use a Dynamic DNS service to set up
@raveenb
raveenb / ssh_into_android.md
Last active May 5, 2025 11:07
SSH into Android

Connecting to an Android device over SSH

Initial Setup

Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it to get the latest version, The APK can be downloaded from https://apkpure.com/termux/com.termux/ Install the APK using by running

adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
@robin-a-meade
robin-a-meade / unofficial-bash-strict-mode.md
Last active June 6, 2025 20:24
Unofficial bash strict mode

Unofficial Bash Strict Mode

Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:

set -euo pipefail

set -e

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 13, 2025 07:17
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@volks73
volks73 / AutoHotkey.ahk
Created September 26, 2017 14:47
AutoHotkey script to change Caps Lock to Control on hold and Escape on press and release
; Change Caps Lock to Control when held down; otherwise, Escape
;
; Originally based on the answer provided in
; [this](https://superuser.com/questions/581692/remap-caps-lock-in-windows-escape-and-control)
; StackExchange SuperUser question.
;
; A shortcut should be created for this script and placed in the Windows 10
; user's startup folder to automatically enable the feature on boot/startup.
; The user's startup folder can be found using the following steps:
;
@pascaliske
pascaliske / git-diff.md
Last active April 16, 2024 14:32
Collection of useful diff tools for git

Useful git diff tools

Overview

  • Word: docx2txt (brew install docx2txt)
  • Excel: xlsx2txt
  • PDF: pdf2txt (brew install poppler)
  • Images: exiftool (brew install exiftool)

Setup