Skip to content

Instantly share code, notes, and snippets.

Avatar

Constantine Lignos ConstantineLignos

View GitHub Profile
View Sleep Study Analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConstantineLignos
ConstantineLignos / Presidential Ratings Stub.ipynb
Last active Oct 23, 2016
Python Bootcamp Notebook Examples
View Presidential Ratings Stub.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConstantineLignos
ConstantineLignos / openblas_ubuntu_compilation.txt
Last active Mar 22, 2021
Set up OpenBLAS with NO_AFFINITY=1 to make it most useful for applications such as R.
View openblas_ubuntu_compilation.txt
1. Check out OpenBlas from https://github.com/xianyi/OpenBLAS and check out the master branch.
2. Build and install to /opt:
a.) Multi-threaded:
make NO_AFFINITY=1
b.) Single-threaded:
sudo make PREFIX=/opt install
3. Configure it as your BLAS of choice:
sudo update-alternatives --install /usr/lib/libblas.so.3gf libblas.so.3gf /opt/lib/libopenblas.so.0 50
4. Check the configuration to make sure it's selected
update-alternatives --config libblas.so.3gf
@ConstantineLignos
ConstantineLignos / freqsampler.py
Created Mar 22, 2013
Sample items (i.e., words) from a list of items based on their frequencies. Assumes the input file contains lines of the form "<count> <item>".
View freqsampler.py
#!/usr/bin/env python
"""Randomly sample items from a list of items with their frequencies."""
import sys
import random
from operator import itemgetter
def parse_countword_line(line):
@ConstantineLignos
ConstantineLignos / show_ignored_untracked.sh
Created Mar 5, 2013
Make git list untracked files that have been ignored. Useful if you want to verify that there's nothing you care about in your ignores.
View show_ignored_untracked.sh
git ls-files -oi --exclude-standard
@ConstantineLignos
ConstantineLignos / picosat_additions.h
Last active Mar 12, 2018
Building picosat on Windows.
View picosat_additions.h
/* Turn off features that will not work on Windows.
*/
#define NGETRUSAGE
#define NALLSIGNALS
@ConstantineLignos
ConstantineLignos / oneref.tex
Created Dec 18, 2012
Info for fixing whitespace parsing issue in checkcites.
View oneref.tex
\documentclass{article}
\begin{document}
This is a test \cite{foo2012}.
\bibliographystyle{plain}
\bibliography{tworef}
\end{document}
@ConstantineLignos
ConstantineLignos / viewtsv.sh
Created Aug 3, 2012
View TSVs nicely in the terminal
View viewtsv.sh
#!/usr/bin/env bash
column -t -s $'\t' $1 | less -S
@ConstantineLignos
ConstantineLignos / gist:2929803
Created Jun 14, 2012
Bash PS1 with user@host, full path, and git_ps1, each in their own color
View gist:2929803
GIT_PS1_SHOWDIRTYSTATE=1
PS1='[\[\e[1;32m\]\u@\h \[\e[1;36m\]\w\[\e[1;35m\]$(__git_ps1 " (%s)")\[\e[0m\]]\$ '
@ConstantineLignos
ConstantineLignos / printprettytxt.sh
Created Feb 14, 2012
Print plain text files by order of filename, with pretty headers
View printprettytxt.sh
find . -name "*.txt" | sort | xargs -n 1 enscript -G