Skip to content

Instantly share code, notes, and snippets.

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

#! /usr/bin/env python
import sourmash
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-k", "--ksize", type=int, default=51)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@luizirber
luizirber / convert.py
Created November 29, 2017 00:21
A small Python script to convert lastpass CSV files to a format that Password Gorilla can import
#!/usr/bin/env python
"""
A small Python script to convert lastpass CSV files to a format that Password Gorilla can import.
Usage:
python convert.py lastpass.csv output.csv
output.csv can now be imported into Password Gorilla
"""
@luizirber
luizirber / README.md
Last active November 13, 2016 01:56 — forked from ctb/README.md
Cython maps

Here, the .get function on maps is about 1m times slower than the .getitem function. Why?

To run (requires Python 3, Cython, and a C/C++ build environment):

python setup.py build_ext -i
python test.py

Keybase proof

I hereby claim:

  • I am luizirber on github.
  • I am luizirber (https://keybase.io/luizirber) on keybase.
  • I have a public key ASDsj5v-XomuzwQ-xjEdfyM0dVXLdrX8SHWo_5nseZ55Rgo

To claim this, I am signing this object:

@luizirber
luizirber / gist:3f7f09e5144f3506207152fae6d4b06f
Created May 5, 2016 16:45
A canção do programador (Lightning talk na Python Brasil 2013 -> https://youtu.be/_-AHNX-TYks )
Eu nunca quis ser um barbeiro… Eu sempre quis ser… Um programador!
Seja sozinho ou pareado, eu iria programar, programar, programar!
Eu sou programador, que maravilha!
Programo de noite, café de dia!
(ele é programador, que maravilha!
Programa de noite, café de dia!)
Programo pra web, pra desktop, programo para celular
hospedo tudo na nuvem, pra disponibilizar
@luizirber
luizirber / timings.ipynb
Created September 30, 2014 23:24
Empty list and appending, or list(convert_str)?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@luizirber
luizirber / brace_expand.py
Created August 7, 2014 04:42
Basic bash brace expansion exercise
def brace_expand(expr):
expansions = []
for block in expr.split('{'):
if '}' in block:
expansion, remainder = block.split('}')
expanded = []
for piece in expansions:
for component in expansion.split(','):
expanded.append("".join((piece, component, remainder)))
expansions = expanded
@luizirber
luizirber / alg3.py
Created March 25, 2014 19:14
Fluctuating environment
import random
RESOURCES = [0, 1]
GENE_MUTATION_RATE = .05
POPULATION_SIZE = 20
NUMBER_OF_GENERATIONS = 100
class Org(object):
def __init__(self, genes):