This file contains hidden or 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
# get the list of PIDs and cpu use, sort numerically using the second column or key, take the last one, and extract the second column | |
ps —no-headers -eo pid,%cpu | sort -k2 -n | tail -1 | cut -d ' ' -f 2 |
This file contains hidden or 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
print(list(filter( lambda pow2: pow2^(pow2-1) > pow2, range(1000)))) |
This file contains hidden or 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
HTML = $(patsubst %.md,%.html,$(wildcard *.md)) | |
all: $(HTML) | |
$(HTML): %.html: %.md | |
ifneq ($(shell command -v pandoc 2> /dev/null),) | |
pandoc $< -o $@ | |
else | |
ifneq ($(shell command -v markdown-html 2> /dev/null),) | |
markdown-html $< -o $@ |
This file contains hidden or 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
HTML = $(patsubst %.md,%.html,$(wildcard *.md)) | |
all: $(HTML) | |
$(HTML): %.html: %.md | |
pandoc $< -o $@ |
This file contains hidden or 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
.PHONY = count | |
HTML = $(patsubst %.md,%.html,$(wildcard *.md)) | |
count: ;@echo $(HTML) |
This file contains hidden or 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
.PHONY = count | |
MD = $(wildcard *.md) | |
HTML = $(MD:.md=.html) | |
count: ;@echo $(HTML) |
This file contains hidden or 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
.PHONY = count | |
MAKEFILES = $(wildcard *.mk) | |
count: ;@echo $(MAKEFILES) |
This file contains hidden or 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
%.pdf: %.tex | |
pdflatex $< | |
bibtex $(basename $<) | |
pdflatex $< | |
pdflatex $< |
This file contains hidden or 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
.PHONY = commit | |
status: | |
-git status -s | grep . && touch status | |
commit: status | |
rm status; make -f 3.mk | |
git commit -am "$(msg)" |
This file contains hidden or 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
.PHONY: spellcheck | |
spellcheck: | |
hunspell -p words.dic -l *.md | grep . && exit 2 || exit 0 |