Skip to content

Instantly share code, notes, and snippets.

View davidalbertonogueira's full-sized avatar
🚀
building stuff

David Nogueira davidalbertonogueira

🚀
building stuff
  • Lisbon
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davidalbertonogueira
davidalbertonogueira / script.pl
Last active July 26, 2019 14:22
Script to generate data similar to what's shown in post 'At what time of day does famous programmers work? Part 2. Workweek vs Weekend.', but with daily statistics — based on https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
#!/usr/bin/perl
#this script is made to show graphs with git commit time made on monday vs tuesday vs wednesday vs thursday vs friday vs saturday vs sunday
#
# The desription of this script and results of its usage is avaliable at:
# https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
#
# usage:
#
# git log --author="Sebastian Riedel" --format="%H %ai" | perl script.pl
#
def main():
import sqlite3
from sqlite3 import Error
def create_connection(db_file):
""" create a database connection to a SQLite database """
try:
conn = sqlite3.connect(db_file, isolation_level=None)
#print(sqlite3.version)
@davidalbertonogueira
davidalbertonogueira / pyICU_tokenizer.ipynb
Created April 4, 2019 16:53
pyICU tokenizer wrapper
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davidalbertonogueira
davidalbertonogueira / fastText_multilingual_alignment.ipynb
Last active April 4, 2019 10:43
alignment to english of Fast text embeddings (using alignment matrices from Babylonpartners/fastText_multilingual)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
docker build -t myapp:2.0 .
docker run --name myapp_2.0 -d -p 7777:7000 myapp:2.0
docker run --name myapp_2.0 -it -p 7777:7000 myapp:2.0
## -it is short for --interactive + --tty when you docker run with this command.
## it would take you straight inside of the container,
## where -d is short for --detach which means you just run the container and
## then detach from it so basically you run container in the background.
## edit : so if you run docker container with -itd it would run the-it options and detach you from the container,
## so your container still running in the background even without any default app to run.
@davidalbertonogueira
davidalbertonogueira / docker.ps
Created October 22, 2018 09:45
Docker commands
docker build -t myapp:2.0 .
docker run --name myapp_2.0 -d -p 7777:7000 myapp:2.0
docker run --name myapp_2.0 -it -p 7777:7000 myapp:2.0
## -it is short for --interactive + --tty when you docker run with this command.
## it would take you straight inside of the container,
## where -d is short for --detach which means you just run the container and
## then detach from it so basically you run container in the background.
## edit : so if you run docker container with -itd it would run the-it options and detach you from the container,
## so your container still running in the background even without any default app to run.
@davidalbertonogueira
davidalbertonogueira / MUSEembeddingsexploration.ipynb
Last active October 16, 2018 14:08
MUSE cross lingual embeddings
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davidalbertonogueira
davidalbertonogueira / MicroSecResolutionClock.h
Created March 13, 2017 20:24
std::chrono::system_clock with microseconds duration
// @brief Created on top of std::chrono::system_clock,
// MicroSecResolutionClock offers a clock with microseconds duration.
struct MicroSecResolutionClock : public std::chrono::system_clock {
typedef std::chrono::microseconds duration;
typedef duration::rep rep;
typedef duration::period period;
typedef std::chrono::time_point<MicroSecResolutionClock, duration> time_point;
static const bool is_steady = false;
static const int ticks_per_time_t = period::den;
@davidalbertonogueira
davidalbertonogueira / library_makefile
Created November 14, 2016 17:25
Generic Program makefile and Library makefile
#!/bin/bash
# Makefile for RandomLibrary
CC = ~/clang-3.8.0/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
DEBUG = -g
AUXLIBS =
AUXINCLUDES =
LOCALDEPSINCLUDES =
INCLUDES = -I$(AUXINCLUDES) -I$(LOCALDEPSINCLUDES)