Skip to content

Instantly share code, notes, and snippets.

View nip10's full-sized avatar
🎯
Focusing

Diogo Cardoso nip10

🎯
Focusing
View GitHub Profile
@nip10
nip10 / app.py
Created June 13, 2023 11:28
presale movies
# instructions:
# pip3 install requests
# python3 app.py
import requests
import json
def fetch_and_print_data():
url = "https://www.cinemas.nos.pt/graphql/execute.json/cinemas/getTopMovies"
response = requests.get(url)
@nip10
nip10 / bg-psd2.yaml
Created June 26, 2022 12:30 — forked from amilos/bg-psd2.yaml
Berlin Group PSD2 API specified in Openapi v3 format
openapi: 3.0.1
info:
title: BG PSD2 API
version: "1.2"
description: |
# Summary
The **NextGenPSD2** *Framework Version 1.2* offers a modern, open, harmonised and interoperable set of
Application Programming Interfaces (APIs) as the safest and most efficient way to provide data securely.
The NextGenPSD2 Framework reduces XS2A complexity and costs, addresses the problem of multiple competing standards
in Europe and, aligned with the goals of the Euro Retail Payments Board,
@nip10
nip10 / sw-template.js
Last active March 3, 2020 17:59
workbox background sync
/* eslint-disable no-undef */
/* eslint-disable no-restricted-globals */
if ("function" === typeof importScripts) {
importScripts(
"https://storage.googleapis.com/workbox-cdn/releases/5.0.0/workbox-sw.js"
);
//The new installed service worker replaces the old service worker immediately
self.skipWaiting();
self.addEventListener("install", function(event) {
### Keybase proof
I hereby claim:
* I am nip10 on github.
* I am nip10 (https://keybase.io/nip10) on keybase.
* I have a public key ASC3NctkuX9-PzqCjjbT48cGl66Z1rCh7VK7KRgytufYEgo
To claim this, I am signing this object:
@nip10
nip10 / README-Template.md
Created January 23, 2019 01:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@nip10
nip10 / SerialPort.cpp
Created December 2, 2018 00:21 — forked from yoggy/SerialPort.cpp
SerialPort class sample using boost::asio::serial_port
#include "StdAfx.h"
#include <Setupapi.h>
#pragma comment(lib, "Setupapi.lib")
#include "SerialPort.h"
SerialPort::SerialPort(void) : end_of_line_char_('\n')
{
}
@nip10
nip10 / install_opencv.sh
Created November 12, 2018 21:18
Install OpenCV on Ubuntu
# Originally at https://github.com/milq/milq/blob/master/scripts/bash/install-opencv.sh
######################################
# INSTALL OPENCV ON UBUNTU OR DEBIAN #
######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |------------------------------------------------------|
# | OS | OpenCV | Test | Last test |
# |------------------|--------------|------|-------------|
# | Ubuntu 18.04 LTS | OpenCV 3.4.2 | OK | 18 Jul 2018 |
import {action1, action2} from "myActions";
import {bindActionCreators} from "redux";
const mapDispatchToProps(dispatch) => {
return {
manuallyBoundAction : (...args) => dispatch(action1(...args)),
autoBoundAction : bindActionCreators(action2, dispatch),
multipleActionsTogether : bindActionCreators({action1, action2}, dispatch)
}
};
@nip10
nip10 / dispatching-action-creators.js
Created October 7, 2018 17:34 — forked from markerikson/dispatching-action-creators.js
Dispatching action creators comparison
// approach 1: define action object in the component
this.props.dispatch({
type : "EDIT_ITEM_ATTRIBUTES",
payload : {
item : {itemID, itemType},
newAttributes : newValue,
}
});
// approach 2: use an action creator function
@nip10
nip10 / letsencrypt_2018.md
Created August 9, 2018 21:29 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: