Skip to content

Instantly share code, notes, and snippets.

View nanounanue's full-sized avatar
💭
😡

Adolfo De Unánue nanounanue

💭
😡
View GitHub Profile
@nanounanue
nanounanue / get_latest_release.sh
Last active September 6, 2018 19:06 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
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
@nanounanue
nanounanue / greek-letters-abbrevs.el
Created September 2, 2018 02:58 — forked from egarson/greek-letters-abbrevs.el
Emacs abbrev table for Greek lower- and upper-case letters. See abbrev-mode for more.
(define-abbrev-table 'greek-abbrev-table
'(
;; Greek small letters
("8al" "α")
("8be" "β")
("8ga" "γ")
("8de" "δ")
("8ep" "ε")
("8ze" "ζ")
("8et" "η")
@nanounanue
nanounanue / HW7.ipynb
Created August 23, 2018 04:42 — forked from rtbs-dev/HW7.ipynb
Bayes, Kalman, and Sobol
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nanounanue
nanounanue / pmml_bayesnet.ipynb
Created August 23, 2018 04:41 — forked from rtbs-dev/pmml_bayesnet.ipynb
Bayesian Network Models in PyMC3 and NetworkX
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nanounanue
nanounanue / Dell XPS 15 9560 Manjaro Setup instructions
Created May 26, 2018 23:17 — forked from meirbon/Dell XPS 15 9560 Manjaro Setup instructions
Small, quick guide to set up Manjaro on the XPS 15 9560
# 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
@nanounanue
nanounanue / pypossibly.py
Created May 6, 2018 17:59 — forked from ekampf/pypossibly.py
Python option patrern (Maybe Monad)
import logging
import sys
class Maybe(object):
pass
class Nothing(Maybe):
def is_some(self):
return False
@nanounanue
nanounanue / coroutine.py
Created April 25, 2018 06:07 — forked from flashingpumpkin/coroutine.py
Decorator for coroutine usage.
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.
@nanounanue
nanounanue / git-tag-delete-local-and-remote.sh
Created April 11, 2018 06:23 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# 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
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
@nanounanue
nanounanue / pandas_crossjoin_example.py
Created March 30, 2018 16:40 — forked from internaut/pandas_crossjoin_example.py
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. See https://mkonrad.net/2016/04/16/cross-join--cartesian-product-between-pandas-dataframes.html
"""
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