Skip to content

Instantly share code, notes, and snippets.

View FazioNico's full-sized avatar
🏴‍☠️

Nicolas Fazio FazioNico

🏴‍☠️
View GitHub Profile
@FazioNico
FazioNico / actions.yml
Created September 25, 2023 20:16
[For Students] Github Action that deploy to Github Pages
name: Deploy Github Page
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@FazioNico
FazioNico / app-updates-notification.ts
Last active September 25, 2023 20:59
[For Students] Exemple component that display update notification with Service Worker
import { Component, ViewEncapsulation } from '@angular/core';
import { SwUpdate } from '@angular/service-worker';
import { merge, Observable, of, Subject } from 'rxjs';
import { map } from 'rxjs/operators';
import { ToastOptions } from '@ionic/core';
import { ToastController } from '@ionic/angular';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-updates-notification',
import * as functions from "firebase-functions";
import { Request, Response } from "firebase-functions";
import * as cors from 'cors';
const corsHandler = cors({origin: true});
// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript
export const helloWorld = functions.https.onRequest((request: Request, response: Response) => {
corsHandler(request, response, () => {
@FazioNico
FazioNico / main.py
Last active July 13, 2022 13:02
Google Cloud function Authentication with Firebase
import firebase_admin
from firebase_admin import auth
from firebase_admin import db
import json
# Initialize the app without credentials, as the function gets it from context
firebase_admin.initialize_app()
def hello_world(request):
<!DOCTYPE html>
<html lang="en">
<head>
<base href="./">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./main.esm.js"></script>
</head>
@FazioNico
FazioNico / excel-to-json.html
Last active September 2, 2021 17:37
Convert EXCEL file to JSON Object from browser using Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@FazioNico
FazioNico / cff.js
Last active December 1, 2020 16:48
[For Student]: Build Simple CFF Timetable Application
/**
* EXO FETCH et MANIPULATION DES DONNÉES
* DOC API: https://timetable.search.ch/api/help.en.html
* */
// APPLICATION CFF SIMPLE:
const buildSearchHTML = () => {
const contener = document.querySelector('#cffApp');
contener.innerHTML = `
<input id="from" type="text" />
// Based off of Shawn Van Every's Live Web
// http://itp.nyu.edu/~sve204/liveweb_fall2013/week3.html
// Using express: http://expressjs.com/
var express = require('express');
// Create the app
var app = express();
// Set up the server
// process.env.PORT is related to deploying on heroku
const ytadkiller = () => {
if (window['yt-add-skiper-init'])
window['yt-add-skiper-init'].clearInterval();
// init counter
window['yt-add-skiper-count'] = 0;
// init
window['yt-add-skiper-init'] = setInterval(_=> {
const el = document.querySelector('.ytp-ad-skip-button.ytp-button');
if (!el) return;
// count
const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin");
module.exports = {
entry: './src/app/app.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {