ls
list files
ls -l
which
identify the location of a executable
whereis
mkdir
create directory
wget
download from url: e.g. $ wget http://example.com/file.tar -O ~/path/file.tar
\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Standalone python script for QGIS3 on OSX. | |
""" | |
import os | |
import sys | |
# Define plugin locations from QGIS3 | |
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/') | |
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/plugins') | |
# Define Qt5 plugin path since Qt5 can't find it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function transfer | |
if test (count $argv) -eq 0 | |
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" | |
return 1 | |
end | |
## get temporarily filename, output is written to this file show progress can be showed | |
set tmpfile ( mktemp -t transferXXX ) | |
## upload stdin or file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function SaveAllSheetsAsCSV(outputPath As String) | |
On Error GoTo Heaven | |
' each sheet reference | |
Dim Sheet As Worksheet | |
' path to output to | |
'Dim outputPath As String | |
' name of each csv | |
Dim OutputFile As String |
This hook warns you before you accidentally commit large files to git. It's very hard to reverse such an accidental commit, so it's better to prevent it in advance.
Since you will likely want this script to run in all your git repos, a script is attached to add this hook to all git repos you create / clone in the future.
Of course, you can just download it directly to the hooks in an existing git repo.
If you find this script useful, you might enjoy our more heavy-duty project FastDS, which aims to make it easier to work with versioning in data science projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile | |
# | |
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc | |
# <http://johnmacfarlane.net/pandoc/> | |
# | |
# Run "make" (or "make all") to convert to all other formats | |
# | |
# Run "make clean" to delete converted files | |
# Convert all files in this directory that have a .md suffix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.environ['OPENAI_API_KEY'] = '<Your OpenAI API Key>' | |
# See here on how to find your Zotero info: https://github.com/urschrei/pyzotero#quickstart | |
ZOTERO_USER_ID = '<Your Zotero User ID>' | |
ZOTERO_API_KEY = '<Your Zotero API Key>' | |
ZOTERO_COLLECTION_ID = '<Your Zotero Collection ID>' | |
question = 'What predictive models are used in materials discovery?' | |
# The following prompt instruction is injected to limit the number of keywords per query |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule