Skip to content

Instantly share code, notes, and snippets.

View josevarghese's full-sized avatar
:electron:
Building something new 🥳

Jose Varghese josevarghese

:electron:
Building something new 🥳
View GitHub Profile
@martinschierle
martinschierle / cwv_crawler.js
Last active August 3, 2020 12:39
Small puppeteer script to run over a domain, crawl random urls, capture screenshots with lcp and cls elems highlighted, and also writing out a heatmap of lcp and cls bounding boxes across all crawled pages.
const puppeteer = require('puppeteer');
const { createCanvas, loadImage } = require('canvas')
const mustache = require('mustache')
var fs = require('fs');
const fsExtra = require('fs-extra')
let MAX_URLS = 50;
let TEMPLATE = fs.readFileSync('template.html', 'utf8');
@martinschierle
martinschierle / sw_performance_check.js
Last active October 24, 2022 20:04
Puppeteer script to check performance of a page with and without service worker
// Idea and some code stemming from https://michaljanaszek.com/blog/test-website-performance-with-puppeteer#cacheAndServiceWorker
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const {URL} = require('url');
var fs = require('fs');
var sw_scope;
let NETWORK_PRESETS = {
'GPRS': {
'offline': false,
@jirawatee
jirawatee / MyFirebaseMessagingService.java
Last active July 14, 2022 20:58
FCM - MyFirebaseMessagingService.java
package com.example.fcm;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
@zloynemec
zloynemec / adminer_setup.sh
Created April 15, 2015 12:29
Secure adminer nginx setup
# Secure adminer setup
# Author Taras Kozlov
# download adminer to separate directory
mkdir -p /var/www/admin
cd /var/www/admin
wget http://www.adminer.org/latest.php -O adminer.php
echo '<?php phpinfo(); >' > info.php
sudo -i