⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
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 scrollDown() { | |
const wrapper = document.querySelector("#search-page-list-container"); | |
await new Promise((resolve, reject) => { | |
var totalHeight = 0; | |
var distance = 600; | |
var timer = setInterval(async () => { | |
var scrollHeightBefore = wrapper.scrollHeight; | |
wrapper.scrollBy(0, distance); | |
totalHeight += distance; |
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 * as cheerio from "cheerio"; | |
import puppeteerExtra from "puppeteer-extra"; | |
import stealthPlugin from "puppeteer-extra-plugin-stealth"; | |
import chromium from "@sparticuz/chromium"; | |
async function searchGoogleMaps() { | |
try { | |
const start = Date.now(); | |
puppeteerExtra.use(stealthPlugin()); |
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
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
import "./Utils.sol"; | |
// Core SVG utilitiy library which helps us construct | |
// onchain SVG's with a simple, web-like API. | |
library svg { | |
/* MAIN ELEMENTS */ | |
function g(string memory _props, string memory _children) | |
internal |
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
/** | |
*Submitted for verification at Etherscan.io on 2021-04-22 | |
*/ | |
// File: @openzeppelin/contracts/utils/Context.sol | |
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.6.0 <0.8.0; |
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
MIT License | |
Copyright (c) 2021 Daniel Ethridge | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
// www.featherattribution.com. Brought to you by www.scrapingbee.com and www.freddyfeedback.com | |
class FeatherAttribution { | |
constructor(options) { | |
this.storageItems = ['feather_utm_source', 'feather_utm_medium', 'feather_utm_campaign', 'feather_utm_content', 'feather_ref', 'feather_referrer']; | |
this.checkExpiryDates(); | |
this.setOptions(options); | |
this.referrer = document.referrer; | |
this.ref = this.getParameterByName('ref'); |
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
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c> |
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
/* | |
* Serverless Geolocation Service, hosted on Cloudflare Workers. | |
* | |
* Learn more at https://maxkostinevich.com/blog/serverless-geolocation | |
* | |
* (c) Max Kostinevich / https://maxkostinevich.com | |
*/ | |
// https://gist.github.com/maephisto/9228207 |
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
Rank | Type | Prefix/Suffix | Length | |
---|---|---|---|---|
1 | Prefix | my+ | 2 | |
2 | Suffix | +online | 6 | |
3 | Prefix | the+ | 3 | |
4 | Suffix | +web | 3 | |
5 | Suffix | +media | 5 | |
6 | Prefix | web+ | 3 | |
7 | Suffix | +world | 5 | |
8 | Suffix | +net | 3 | |
9 | Prefix | go+ | 2 |
NewerOlder