Skip to content

Instantly share code, notes, and snippets.

View logc's full-sized avatar

Luis Osa logc

View GitHub Profile
@logc
logc / texdeps.sh
Created January 24, 2017 11:24
Installs TexLive dependencies in order to build "HPC book" by V. Eijkhout, available at https://bitbucket.org/VictorEijkhout/hpc-book-and-course
#! /usr/bin/env sh
wget http://mirrors.ctan.org/macros/latex/contrib/undertilde.zip
unzip undertilde.zip
cd undertilde
latex undertilde.ins
latex undertilde.dtx
makeindex undertilde.idx
mkdir -p /Users/$USER/Library/texmf/tex/latex/undertilde/
mv undertilde.sty /Users/$USER/Library/texmf/tex/latex/undertilde/
sudo tlmgr install comment arydshln wrapfig multirow dirtree algorithm2e \
def parse_command_line():
"""Defines and parses command line arguments"""
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', action='count', default=0)
return parser.parse_args()
def configure_logging(args):
"""Configures logging as specified by the author and the user"""
levels = [logging.WARNING, logging.INFO, logging.DEBUG]
@logc
logc / gdb-session.fish
Created May 13, 2016 19:03
How to add a new structure to a GDB session
❯ gcc -g minimal.c -o minimal
❯ sudo gdb minimal
Password:
(gdb) break main
Breakpoint 1 at 0x100000f90: file minimal.c, line 3.
(gdb) run
Starting program: /private/tmp/c-repl/minimal
@logc
logc / convert.py
Last active November 16, 2015 11:49
"""
Convert: filename of Gmail contacts -> XLSX file
Converts the contents of a filename where exported Gmail contacts can be found
into an XLSX spreadsheet where only the relevant information of the contacts is
found.
"""
import argparse
import codecs
import os
@logc
logc / main.cpp
Last active August 29, 2015 13:58
kNN with Boost::Geometry
#include <functional>
#include <iostream>
#include <random>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace bg = boost::geometry;