Skip to content

Instantly share code, notes, and snippets.

View NateWeiler's full-sized avatar

Nathan Weiler NateWeiler

View GitHub Profile
@NateWeiler
NateWeiler / All the keywords in python.md
Last active March 9, 2021 07:22
All the keywords in python

List of Keywords in Python

This provides a brief information on all keywords used in Python.

Keywords are the reserved words in Python. We cannot use a keyword as a variable name, function name or any other identifier.


Here's a list of all keywords in Python Programming

@NateWeiler
NateWeiler / C or C++ Compiler On Android Using Termux (Linux Environment).md
Created March 9, 2021 06:56
GCC / Clang C/C++ Compiler On Android Using Termux (Linux Environment)

Install Termux App

apt update && apt uprade -y

We have to install the nano text editor to write our code.

apt install -y nano
@NateWeiler
NateWeiler / 10 Need to Know Mac Terminal Commands.md
Created February 22, 2021 16:30
10 Need to Know Mac Terminal Commands

10 Need to Know Mac Terminal Commands

When navigating the computer's file/folder system, there are a handful of commands that will be used the most. We are going to go over some of the most key, essential ones:

@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.
@NateWeiler
NateWeiler / Turn off the CRLF will be replaced by LF.md
Last active May 7, 2024 17:58
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 / 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 / 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 / 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 / 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 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'