Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View diegoquintanav's full-sized avatar
🐢
Working from home

Diego Quintana diegoquintanav

🐢
Working from home
View GitHub Profile
@diegoquintanav
diegoquintanav / convert-to-pdf
Last active January 17, 2021 17:46
shrink slides or pdfs to nxm sheets per page
#!/bin/bash
# converts to pdf all txt files in a folder
# and produces a single pdf of all of them together
for filename in $(ls *.txt); do
libreoffice --convert-to "pdf" "$filename"
done
@diegoquintanav
diegoquintanav / ABOUT.md
Last active April 5, 2022 09:16
docker-compose for graph-tool
We can't make this file beautiful and searchable because it's too large.
5785, 0
11, 0,0
1, 0,0,0
1, 0,0,100,100
8, 0,1
1, 0,24
1, 0,8192
87, 0.0
49, 0.00
10, 0.000
@diegoquintanav
diegoquintanav / ABOUT.md
Created September 21, 2019 11:42
Toy postgres instance with `pgadmin4` and docker compose

Getting a postgres instance with pgadmin4 🐘 and docker-compose 🐳

  1. Use Linux and have docker and docker-compose installed.
  2. Create a folder
  3. Put docker-compose.yml and servers.json
  • Optional: Put a SQL script to be executed at first run from the db service.
  1. docker-compose up -d
  2. Go to 0.0.0.0:5050 and login with test@test.com and test as password
  3. Access the database with the test password
  4. You have a database to play!
@diegoquintanav
diegoquintanav / palindromes_with_jutge.md
Last active September 21, 2019 10:32
working around Jutge's evaluation method

Given the requirements.txt file

pytest
jutge

Consider the palindrome problem in palindrome.py

@diegoquintanav
diegoquintanav / git-events.md
Last active August 30, 2019 16:23
events describing error using an interactive rebase, and going back

So I messed up with git

TL;DR

  1. Everything is under control
  2. Did an interactive rebase to move a commit to the base of my branch, forgot to include merge commits
  3. Lost my merge commits
  4. Tried to go back with git reset --hard and reflog
  5. Ended up at the base of my branch, with my unrebased commits dangling after it
  6. Want to move back to step 0, and hopefully do step 1 again, but including merge commits.
@diegoquintanav
diegoquintanav / footer-flask-bootstrap.md
Last active October 15, 2020 19:25
Defining a footer with flask-bootstrap
@diegoquintanav
diegoquintanav / fizzbuzz.py
Last active March 25, 2020 09:24
fizzbuzz
import sys [0/6141]
"""A simple python implementation of the FizzBuzz problem.
*caveat*: It considers zero as divisible by three and five
see https://www.google.com/search?client=ubuntu&channel=fs&q=fizzbuzz+problem&ie=utf-8&oe=utf-8
and http://wiki.c2.com/?FizzBuzzInManyProgrammingLanguages
"""
@diegoquintanav
diegoquintanav / extra_dependencies_gitlab.md
Last active January 16, 2019 23:27
installing `extra_requires` dependencies from private git repositories

The struggle is real: Basically this bit in a setup.py worked for me.

extras_require={
        'extrapackage':  ["git@git+ssh://git@gitlab.com/<user>/<repository_name>.git"],
        },

then it's possible to do pip install -e .[extrapackage] given you have proper ssh access

@diegoquintanav
diegoquintanav / config.py
Last active March 25, 2020 09:26
instance configuration in Flask
## instance/config.py
HELLO_ENABLED = False