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
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | jq -r .tag_name | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |
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
(define-abbrev-table 'greek-abbrev-table | |
'( | |
;; Greek small letters | |
("8al" "α") | |
("8be" "β") | |
("8ga" "γ") | |
("8de" "δ") | |
("8ep" "ε") | |
("8ze" "ζ") | |
("8et" "η") |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# 1. First of all of course get Manjaro: | |
https://manjaro.org/get-manjaro/ | |
# I recommend using Etcher to copy the image to your USB: | |
https://etcher.io/ | |
# 2. Before installing make sure: | |
# - Secure boot is disabled in BIOS | |
# - Your SSD, HDD or NVME drive is set to AHCI instead of RAID | |
# - Fastboot should be on Auto or minimal, but this shouldn't matter to much |
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 logging | |
import sys | |
class Maybe(object): | |
pass | |
class Nothing(Maybe): | |
def is_some(self): | |
return False |
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
def coroutine(func): | |
""" | |
A decorator that turns a function with normal input into a coroutine. | |
This decorator takes care of priming the coroutine, doing the looping and | |
handling the closing. | |
The first argument of any decorated function is what was received when | |
data was sent to the coroutine via the ``.send`` method. All the other | |
``*args`` and ``**kwargs`` are what was passed to the decorated function | |
when instantiating the coroutine. |
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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
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
INIT=.emacs.el | |
$(INIT): TC3F.org | |
time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-babel-tangle --kill | |
TC3F.txt: $(INIT) | |
time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-ascii-export-to-ascii --kill | |
TC3F.html: $(INIT) | |
time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-html-export-to-html --kill |
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
""" | |
Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on | |
calculating the distances between origin and destination cities. | |
Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5 | |
Best run this with Spyder (see https://github.com/spyder-ide/spyder) | |
Author: Markus Konrad <post@mkonrad.net> | |
April 2016 |