Skip to content

Instantly share code, notes, and snippets.

📖
Learning

Antonio Feregrino fferegrino

📖
Learning
Block or report user

Report or block fferegrino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fferegrino
fferegrino / i__training_data.csv
Last active Nov 5, 2018
Training set for VuelaX
View i__training_data.csv
We can't make this file beautiful and searchable because it's too large.
0,44,¡,0,faa,1,FALSE,11,n
0,44,CUN,1,np00000,3,TRUE,11,o
0,44,a,5,sp000,1,FALSE,11,s
0,44,Ámsterdam,7,np00000,9,FALSE,11,d
0,44,$,17,zm,1,FALSE,11,n
0,44,"8,960",18,dn0000,5,FALSE,11,p
0,44,!,23,fat,1,FALSE,11,n
0,44,Sin,25,sp000,3,FALSE,11,n
0,44,escala,29,nc0s000,6,FALSE,11,n
View ngrams.py
def ngrams(string, n=3):
# Filter string
ngrams = zip(*[string[i:] for i in range(n)])
return [''.join(ngram) for ngram in ngrams]
@fferegrino
fferegrino / intro-neo4j.adoc
Last active Apr 8, 2019
My introduction to neo4j
View intro-neo4j.adoc

My introduction to neo4j

Introduction to Neo4j

Let’s create our first basic graph! we’ll create something similar to what you saw in the video (or similar to what you see in this image).

@fferegrino
fferegrino / graph_gist_template.adoc
Created Aug 10, 2018 — forked from jexp/graph_gist_template.adoc
CHANGEME: GraphGist Template. Fork to make your own, view source to see instruction comments
View graph_gist_template.adoc

REPLACEME: TITLE OF YOUR GRAPHGIST

Introduction

View load_flights_maps.cypher
LOAD CSV WITH HEADERS FROM 'file:///flights.csv' as line
MATCH
(a:Airline{ iata: line.AIRLINE }),
(departure:Airport{ iata: line.ORIGIN_AIRPORT }),
(destination:Airport{ iata: line.DESTINATION_AIRPORT })
WITH a, departure, destination, line
LIMIT #limit#
CREATE
(f:Flight{
tail_number: line.TAIL_NUMBER,
@fferegrino
fferegrino / insert.txt
Last active Jun 18, 2018
MovieLens database insert
View insert.txt
LOAD CSV WITH HEADERS FROM 'file:///movies.clean.csv' as l
CREATE (m:Movie{movieId:toInteger(l.movieId), tmdbId:l.tmdbId, imdbId:l.imdbId, title:l.title, year:date(l.year)})
CREATE INDEX ON :Movie(movieId)
LOAD CSV WITH HEADERS FROM 'file:///users.csv' as l
CREATE (u:User{userId:toInteger(l.userId)})
CREATE INDEX ON :User(userId)
@fferegrino
fferegrino / policy.txt
Created Jun 15, 2018
Camera Privacy Policy
View policy.txt
This app uses your camera with the sole purpose of delivering its services.
The images captured by the app never leave your phone directly from the app, and they are not stored unless you explicitly authorise them to be saved.
View no_duplicated.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
,label,url,date
0,"¡Todo México a La Habana – $4,718! Opción de hotel 3 estrellas, 2 personas, 3 noches $3,241 pesos con desayunos",http://www.vuelax.com/2018/03/09/mex-cub/,2018-03-09
1,"¡GDL, CDMX y MTY a San José, Costa Rica – $4,222! Opción de hotel 3 estrellas, 7 noches, 2 personas por $6,389",http://www.vuelax.com/2018/03/09/costa-2/,2018-03-09
2,"¡CDMX, MTY, GDL, TIJ y Silao a Venecia – $13,829!",http://www.vuelax.com/2018/03/09/venecia/,2018-03-09
3,"¡CUN a La Habana – $2,997! Opción de hotel 3 estrellas, 3 noches, 2 personas con desayuno por $2,749",http://www.vuelax.com/2018/03/08/havana-cun/,2018-03-08
4,"¡CDMX, MTY y GDL a Liubliana, Eslovenia – $13,870!",http://www.vuelax.com/2018/03/08/cdmx-mty-y-gdl-a-liubliana-eslovenia-13870/,2018-03-08
5,"¡CDMX a Barcelona + Marrakech – $14,288! Opción de hotel 4 estrellas, 2 personas, 5 noches por $2,610 con desayunos",http://www.vuelax.com/2018/03/08/marrakech-2/,2018-03-08
6,"¡CDMX a Barcelona + Marrakech – $14,288! Opción de hotel 4 estrellas, 2 personas
View gist:e0e184354ddb454570c34a707769fa51
import re
import pandas as pd
def __parse_time_elapsed__(time_line):
time = float(time_line.split(":")[1][:-len("seconds.")])
return time
def __file_to_lines__(path):
l = None
You can’t perform that action at this time.