This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let Next.js handle rest of the routes | |
function modifyResponseBody(req, res, next) { | |
var oldSend = res.send; | |
res.send = function (data) { | |
// arguments[0] (or `data`) contains the response body | |
arguments[0] = 'modified : ' + arguments[0]; | |
oldSend.apply(res, arguments); | |
}; | |
res.on('finish', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const collision = { | |
collide: function (el1, el2) { | |
const rect1 = el1.getBoundingClientRect(); | |
const rect2 = el2.getBoundingClientRect(); | |
return !( | |
rect1.top > rect2.bottom || | |
rect1.right < rect2.left || | |
rect1.bottom < rect2.top || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ScriptCache from './script-cache'; | |
class MicroFrontend extends React.Component { | |
scriptCache; | |
abortController; | |
constructor(props) { | |
super(props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number} yPos Pixels from the top of the screen to scroll to | |
* @param {number} duration Time of animation in milliseconds | |
*/ | |
const scrollTo = (yPos, duration = 600) => { | |
const startY = window.scrollY; | |
const difference = yPos - startY; | |
const startTime = performance.now(); | |
const step = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as functions from 'firebase-functions'; | |
const { google } = require('googleapis'); | |
const express = require('express'); | |
const cors = require('cors'); | |
const app = express(); | |
// Automatically allow cross-origin requests | |
app.use(cors({ origin: true })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"title": "MyBusTracker.live", | |
"url": "https://app.mybustracker.live", | |
"excerpt": "Manage all your Students, Vehicles and Staff information. See real-time updates for the bus, its estimated time of arrival and delays if any.\n Be informed of any incidents by real-time push notificationns. Generate reports and rate drivers by A.I driven scoring algorithm.\n ", | |
"info": [ | |
"Built the entire system from ground up in 3 months", | |
"Used NestJS as backend frameword", | |
"Developed the front-end using Angular", | |
"Configured Gitlab CI/CD for Backend and Frontend", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>My App - Clipboard</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' chrome-extension://*;"> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import {Cache} from '../utils/storage.provider'; // Decorator to access local storage | |
let OneSignal; | |
const url = ''; | |
@Injectable() | |
export class OneSignalService { | |
@Cache({pool: 'OneSignal'}) oneSignalInit; // to check if OneSignal is already initialized. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.TargetApi; | |
import android.app.KeyguardManager; | |
import android.hardware.fingerprint.FingerprintManager; | |
import android.os.Build; | |
import android.os.CancellationSignal; | |
import android.security.keystore.KeyGenParameterSpec; | |
import android.security.keystore.KeyProperties; | |
import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |