Skip to content

Instantly share code, notes, and snippets.

Links used:
- https://www.digitalocean.com/community/tutorials/how-to-set-up-a-remote-database-to-optimize-site-performance-with-mysql
- https://stackoverflow.com/a/34040197
- First setup server (see digital ocean tutorial)
- Secondly allow any trafic incoming to port 3306 (port 3306 is by default where MySQL is being listened on)
- Thirdly create a super user granting all permissing from a certain host (see StackOverflow post for more info), or from any host (@'%')
- Finally try to connect to the MySQL server using the super user
@freitzzz
freitzzz / JPAQueryLocalDateTime.md
Last active June 22, 2018 01:01
JPA LocalDateTime Queries

In JPA 2.1 to compare dates as LocalDateTimes, there is need to use the SQL function "CAST" on the JPQL Query

Example:

  • We want to retrieve the number of actions occured on a certain System during a period of time

The entity:

@freitzzz
freitzzz / get_instagram_comments_count_by_url.py
Created July 31, 2018 17:36
Get Count of Instagram Comments of a certain post by it's URL based on web scraping with Python
"""
Gets number of comments of a Instagram Post based on page source using BS4 & JSON from GraphQL extraction
Thanks to <a href="http://edmundmartin.com/scraping-instagram-with-python/">edmundmartin</a> for the
beautiful instagram scraping methodology
"""
def get_instagram_post_comments_count(url):
restX,contentX=httplib2.Http().request(url)
soupX=BeautifulSoup(contentX,"html.parser")
body=soupX.find('body')
script_tag=body.find('script')
@freitzzz
freitzzz / get_instagram_posts_count_by_url.py
Created July 31, 2018 17:48
Get Count of Instagram Posts of a certain user by it's URL based on web scraping with Python
"""
Gets number of posts of a Instagram user based on page source using BS4 & JSON from GraphQL extraction
Thanks to <a href="http://edmundmartin.com/scraping-instagram-with-python/">edmundmartin</a> for the
beautiful instagram scraping methodology
"""
def get_instagram_user_posts_count(url):
restX,contentX=httplib2.Http().request(url)
soupX=BeautifulSoup(contentX,"html.parser")
body=soupX.find('body')
script_tag=body.find('script')
@freitzzz
freitzzz / artices_and_reads.md
Last active September 5, 2018 18:52
Some articles and reads I've been encountering regarding design patterns/architectures which I enjoyed/found as very interesting
@freitzzz
freitzzz / relationship_types_example.md
Last active August 27, 2018 22:24
Examples for each database relationship type

A simple Gist for exampling database relationship types

One-to-One

  • One-to-One relationship type is the easiest to understand, yet probably the rarest to use in database design

  • One-to-One implies that one entity can only exists if another entity exists and vice-versa. One good example for this is the typical citizen card.

    • One Citizen has one SSN which is linked to his card, and his SSN is only linked to his card and not to any other citizen

One-to-Many

@freitzzz
freitzzz / awesome_websites.md
Created January 30, 2019 20:27
Awesome websites

Awesome Websites

A list of websites I've been encountering as I surf through the Internet

Name Description URL
Old-Games Repository with thousands of old games available to download with their information (e.g. name, description, release date, background story https://www.old-games.com/
@freitzzz
freitzzz / get_external_dependencies.py
Created October 21, 2020 15:02
Get Flutter project external dependencies and print them as Markdown tables
#!/usr/bin/env python
import os
import subprocess
import glob
import yaml
@freitzzz
freitzzz / get_packages.dart
Created January 9, 2021 17:46
[one-liner] Flutter get packages in all packages of a project
File('.').listSync(recursive: true).whereType<File>().where((f) => f.path.endsWith('pubspec.yaml')).where((f) => !f.path.contains('ios/.symlinks')).map((f) => f.parent).map((d) => Process.runSync('flutter', ['pub', 'get'], workingDirectory: d.absolute.path)).forEach((x) => print(x.stdout));
@freitzzz
freitzzz / university_projects.md
Last active March 8, 2021 18:52
Remarkable University Projects

Marks are in the scale of 0 to 20 (0/20)

From oldest to newest:

2018

CDIO-IL 2017/2018 - https://github.com/freitzzz/cdioil-2017-g003-backup (19/20)

My first experience in working on a project that is not merely like all university end of semester group projects. Scrum and CDIO frameworks were "sort of" applied in a project along the fourth semester (2º year) of ISEP BSc in Informatics Engineering course, in which three teams of 8 students developed software for a client.