Skip to content

Instantly share code, notes, and snippets.

View NateWeiler's full-sized avatar

Nathan Weiler NateWeiler

View GitHub Profile

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@NateWeiler
NateWeiler / find-hyperlinks.1.sh
Last active February 9, 2021 08:25
Extract href tag values (hyperlinks) from a webpage.
@NateWeiler
NateWeiler / How to connect Git Bash to GitHub.md
Created December 15, 2020 12:53
How to connect Git Bash to GitHub

How to connect Git Bash to GitHub

Setup github password terminal:

$ git config credential.helper store
$ git push https://github.com/owner/repo.git

Username for 'https://github.com': <USERNAME>
Password for 'https://[email protected]': <PASSWORD>
@NateWeiler
NateWeiler / Recursively rename files & folders.md
Created December 27, 2020 12:04
Commands to recursively find files or folders, and rename them.

Commands to recursively find files or folders, and rename them.


Find Files

$ find . -type f -name "*.md" -print > 'Some File.txt'
@NateWeiler
NateWeiler / Install gitflow on Windows.md
Created December 27, 2020 14:04
Install gitflow on Windows

Install gitflow on Windows

Download and install Git from MSysGit or Git SCM. Download and install getopt.exe from the util-linux package into C:\Program Files\Git\bin. (Only getopt.exe, the others util-linux files are not used). Also install libintl3.dll and libiconv2.dll from the Dependencies packages (libintl and libiconv), into the same directory.

Suppose that Git is installed in the folder c:\bin\git and GnuWin32 in the folder c:\bin\GnuWin32.

Clone the git-flow sources from GitHub:

$ git clone --recursive https://github.com/nvie/gitflow.git
@NateWeiler
NateWeiler / Recursively delete empty files & folders.md
Created December 27, 2020 14:27
Recursively delete empty directories

Recursively delete empty directories


List the directories deeply-nested-first

$ find . -depth -type d -exec rm -rf {} \; 2>/dev/null
@NateWeiler
NateWeiler / clipboard.js.md
Created December 28, 2020 01:30
Copying text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But most of all, it shouldn't depend on Flash or any bloated framework. That's why clipboard.js exists.

clipboard.js

Modern copy to clipboard. No Flash. Just 3kb gzipped.

Demo

Copying text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But most of all, it shouldn't depend on Flash or any bloated framework.

That's why clipboard.js exists.

@NateWeiler
NateWeiler / new line in shell script.sh
Created January 6, 2021 02:46
Adding a new line in a shell script examples
#!/bin/sh
echo -e "new line in shell script\n"
echo -e "new line using echo\n"
echo -e "Similar result, using cat\n"
echo -e "hello\nworld\n"
@NateWeiler
NateWeiler / Turn off the CRLF will be replaced by LF.md
Last active November 14, 2024 16:55
How to turn off the “CRLF will be replaced by LF” warning

How to turn off the “CRLF will be replaced by LF” warning

CRLF: Line breaks in windows environment

LF : Line breaks in linux environment

The meaning of this error is that there are two newline characters in the file, git will automatically replace CRLF with LF, so a warning is given.

warning: CRLF will be replaced by LF in [File] . The file will have its original line endings in your working directory.

Turn the auto-conversion feature off in the settings

@NateWeiler
NateWeiler / How to permalink to a gist's raw file.md
Last active February 12, 2021 16:58
How to permalink to a gist's raw file. Linking to the raw version of a gist.