Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ting Sun sunt05

🏠
Working from home
View GitHub Profile
View A hack for showing LaTeX formulas in GitHub markdown.md

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

@myusuf3
myusuf3 / delete_git_submodule.md
Created Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

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
View Notes of WRF.md

Notes of compiling and running WRF-SUEWS on JASMIN

Some often used Linux commands:

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\

@kristopherjohnson
kristopherjohnson / Makefile
Last active Oct 10, 2020
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
View Makefile
# 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
@guysmoilov
guysmoilov / Git pre-commit hook for large files.md
Last active Oct 9, 2020
Git pre-commit hook for large files
View Git pre-commit hook for large files.md

Git pre-commit hook for large files

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.

Installation

View qgis3_standalone_osx.py
"""
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
@nl5887
nl5887 / transfer.fish
Last active Jul 17, 2020
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
View transfer.fish
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
@gwijthoff
gwijthoff / pandocslides-README.md
Last active Jul 14, 2020 — forked from aaronwolen/slides.md
A Pandoc template to generate reveal.js slideshows.
View pandocslides-README.md

Description

This is a Pandoc template to generate reveal.js slideshows.

Definitions

Pandoc is a "universal markup converter" you can run from the command line to convert a simple, plain text file into a beautifully formatted PDF, .docx, HTML, LaTeX, slideshows… the list goes on.

reveal.js is a CSS and JavaScript framework for creating beautiful presentations in HTML5, designed by Hakim El Hattab.

@agathe
agathe / gist:2956101
Created Jun 19, 2012
VBA Excel - Convert each sheet to CSV - For MAC
View gist:2956101
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
You can’t perform that action at this time.