Skip to content

Instantly share code, notes, and snippets.

View bomale's full-sized avatar
😛

Alessandro bomale

😛
View GitHub Profile
@jaydeepkarale
jaydeepkarale / playwright_python_webscraping.py
Last active February 23, 2023 01:24
webscraping on cloud playwright grid in python
import json
import logging
import os
import subprocess
import sys
import time
import urllib
from logging import getLogger
from dotenv import load_dotenv
@getify
getify / 1.html
Last active May 10, 2023 03:25
Ever noticed how vw/vh units in CSS seem to be a bit unreliable on various devices (especially mobile)? Here's my solution.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Test Page</title>
<script>
// early compute the vw/vh units more reliably than CSS does itself
computeViewportDimensions();
@gander
gander / github-watch-releases.ts
Created December 2, 2020 23:33
Use playwright to enable release notifications in all starred repositories
import {chromium as browser, ElementHandle, Page} from "playwright";
import {default as PQueue} from "p-queue"
const username: string = 'gander'
const links = new Set;
let nextPage: string = '';
(async () => {
const pages = new PQueue({concurrency: 7})
@msankhala
msankhala / nginx-ssl-config
Created September 9, 2020 06:50 — forked from apollolm/nginx-ssl-config
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
@daehahn
daehahn / wsl2-network.ps1
Last active June 25, 2024 15:53
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@wikrie
wikrie / synology-fb-cert-transfer.sh
Last active October 22, 2023 13:26 — forked from FvdLaar/fritzbox-cert-update.sh
Fritzbox Fritz!Box AVM SSL Letsencrypt automatically update
#!/bin/bash
# parameters
USERNAME=""
PASSWORD="fritzbox-password"
CERTPATH="/usr/syno/etc/certificate/system/default/" ##this is the default Path for Synology Cert
CERTPASSWORD=""
HOST=http://192.168.178.1 ## I use IP instead of fritz.box for synology updates
# make and secure a temporary file
@tanaikech
tanaikech / submit.md
Last active October 14, 2023 10:53
Highlighting Row and Column of Selected Cell using Google Apps Script

Highlighting Row and Column of Selected Cell using Google Apps Script

This is a sample script for highlighting the row and column of the selected cell using Google Apps Script. For this, the OnSelectionChange event trigger is used.

Demo

Sample script

// two examples
// simple
// and with search
<script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "My Website Name",
"url": "https://example.com",
@tanaikech
tanaikech / submit.md
Last active July 18, 2024 06:01
Parsing HTML using Google Apps Script

Parsing HTML using Google Apps Script

This is a sample script for parsing HTML using Google Apps Script. When HTML data is converted to Google Document, the HTML data can be parsed and be converted to Google Document. In this case, the paragraphs, lists and tables are included. From this situation, I thought that this situation can be used for parsing HTML using Google Apps Script. So I could came up with this method.

In the Sheet API, the HTML data can be put to the Spreadsheet with the PasteDataRequest. But unfortunately, in this case, I couldn't distinguish between the body and tables.

The flow of this method is as follows. In this sample script, the tables from HTML are retrieved.

Flow

describe("Dashboard Page", async() => {
it("Login as Basic", async() => {
await page.goto(baseUrl, {waitUntil: "networkidle0"})
await page.click(".login-btn")
await page.waitForSelector('app-login form > input:nth-child(2)')
await page.type('app-login form > input:nth-child(2)', process.env.USERNAME)
await page.type('app-login form > input:nth-child(4)', process.env.PASSWORD)
await page.click('app-login form > button')
await page.waitForSelector('div.content-container > swiper')
})