Skip to content

Instantly share code, notes, and snippets.

View Lucs1590's full-sized avatar
🤜
Hard Work!

Lucas de Brito Silva Lucs1590

🤜
Hard Work!
View GitHub Profile
@Lucs1590
Lucs1590 / translate_neo4j.py
Created July 5, 2021 01:09
This is a test, in which I try to put in a neo4j database, data translated from a json document (with 700,000 data).
import requests
from py2neo import Graph, Node
from time import time
import json
import re
def main():
t1 = time()
connection = connect_database()
@Lucs1590
Lucs1590 / launch.json
Created August 4, 2021 16:57
Launch to nodemon.
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "nodemon",
"runtimeExecutable": "nodemon",
"program": "${workspaceFolder}/server.js",
"restart": true,
@Lucs1590
Lucs1590 / get_scholar_articles.py
Created January 7, 2022 03:25
Script to get Articles from google scholar, browsing through all the pages of the searched topic.
import csv
import requests
import time
from lxml import html
title_list = []
author_list = []
def get_authors(element):
@Lucs1590
Lucs1590 / itertools_functions.ipynb
Created February 17, 2022 12:53
Gist snippet with popular itertools usage.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lucs1590
Lucs1590 / app.module.ts
Last active July 21, 2022 21:18
Module with translate service.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { AppComponent } from './app.component';
@NgModule({
@Lucs1590
Lucs1590 / en.json
Last active July 22, 2022 00:01
File with english translations.
{
"mainPhrase": "This is the main phrase.",
"subPhrase": "This is the sub phrase.",
"buttonPhrase": "pt-BR"
}
@Lucs1590
Lucs1590 / pt.json
Last active July 22, 2022 00:01
File with portuguese translations.
{
"mainPhrase": "Essa é a frase principal.",
"subPhrase": "Essa é a subfrase.",
"buttonPhrase": "en"
}
@Lucs1590
Lucs1590 / api.service.ts
Created July 22, 2022 00:40
Service to connect with an API that provides the user's IP.
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class ApiService {
@Lucs1590
Lucs1590 / app.component.ts
Last active July 22, 2022 02:16
This is a code to create the main page with the translation resource.
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { lastValueFrom } from 'rxjs';
import { ApiService } from './api.service';
@Component({
selector: 'app-root',
template: `
<div>
<h1 translate> mainPhrase </h1>
@Lucs1590
Lucs1590 / Dockerfile
Created September 19, 2022 20:49
A docker file with R, Java, Python and AWS.
FROM python:3.8-slim-buster
COPY ./requirements.txt /app/requirements.txt
COPY . /app
WORKDIR /app
#JAVA CONFIG
RUN apt-get update
RUN apt-get install -y apt-utils \