This file contains 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 puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({ headless: false }); | |
const page = await browser.newPage(); | |
const client = await page.target().createCDPSession(); | |
await client.send('Network.setBlockedUrls', { | |
urls: [ 'example.com' ] | |
}); | |
await page.goto('https://google.com'); |
This file contains 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
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3357.0 Safari/537.36","lighthouseVersion":"2.8.0","generatedTime":"2018-03-01T17:13:42.981Z","initialUrl":"https://www.bhaskar.com/","url":"https://m.bhaskar.com/","runWarnings":[],"audits":{"is-on-https":{"score":true,"displayValue":"","rawValue":true,"extendedInfo":{"value":[]},"scoringMode":"binary","name":"is-on-https","description":"Uses HTTPS","helpText":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/https).","details":{"type":"list","header":{"type":"text","text":"Insecure URLs:"},"items":[]}},"redirects-http":{"score":true,"displayValue":"","rawValue":true,"scoringMode":"binary","name":"redirec |
This file contains 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
// After exporting Google Analytics data from Google Sheets, | |
// I used this function to convert the paths to hyperlinks. | |
function myFunction() { | |
const spreadsheet = SpreadsheetApp.openById('ID_HERE'); | |
const data = spreadsheet.getSheetByName('NAME_HERE'); | |
// You'll want to update the range. | |
const range = data.getRange('A2:A1561'); | |
const paths = range.getValues(); | |
const values = []; | |
paths.forEach(path => { |
This file contains 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
group: Products | |
Laptop = { | |
model, speed, ram, hd, screen, price | |
2001, 2.00, 2048, 240, 20.1, 3673 | |
2002, 1.73, 1024, 80, 17.0, 949 | |
2003, 1.80, 512, 60, 15.4, 549 | |
2004, 2.00, 512, 60, 13.3, 1150 | |
2005, 2.16, 1024, 120, 17.0, 2500 | |
2006, 2.00, 2048, 80, 15.4, 1700 |
This file contains 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
group: Soccer | |
TEAMS = { | |
Country, WorldRank, Continent | |
France, 1, E | |
USA, 2, NA | |
Mexico, 3, NA | |
Ireland, 4, E | |
Germany, 5, E | |
} |
This file contains 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
async function subscribeButtonHandler() { | |
function permissionRequestCallback(result) { | |
permissionStatus = result; | |
subscribe(); | |
} | |
async function subscribe() { | |
if (subscriptionInFlight) return; | |
subscriptionInFlight = true; | |
if (permissionStatus === 'denied') { | |
console.error('The user explicitly denied notification permission.'); |
This file contains 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
# Run from root repo dir | |
git submodule add https://pigweed.googlesource.com/third_party/github/FreeRTOS/FreeRTOS-Kernel third_party/freertos && | |
git submodule add https://pigweed.googlesource.com/third_party/github/STMicroelectronics/cmsis_core third_party/cmsis_core && | |
git submodule add https://pigweed.googlesource.com/third_party/github/STMicroelectronics/cmsis_device_f4 third_party/cmsis_device && | |
git submodule add https://pigweed.googlesource.com/third_party/github/STMicroelectronics/stm32f4xx_hal_driver third_party/hal_driver | |
# Add to //WORKSPACE | |
new_local_repository( |
This file contains 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 logging # debug | |
log_id = 'debug' # debug | |
logger = logging.getLogger(log_id) # debug | |
handler = logging.FileHandler(f'{log_id}.log') # debug | |
logger.addHandler(handler) # debug | |
logger.setLevel(logging.DEBUG) # debug |