Skip to content

Instantly share code, notes, and snippets.

View adgad's full-sized avatar

Arjun Gadhia adgad

  • Financial Times
  • United Kingdom
View GitHub Profile
@adgad
adgad / gist:d75db7cbbc643ea6dd543a23d68ecbe1
Created March 1, 2024 09:41
article body for 684aa3b5-f983-4668-b353-74cf5f95355a
This file has been truncated, but you can view the full file.
<article id="article-body" data-attribute="article-content-body" class="n-content-body js-article__content-body"><figure class="n-content-image n-content-image--full"><picture><source media="(min-width: 980px)" srcset="https://d1e00ek4ebabms.cloudfront.net/production/a23aece0-5847-4985-be27-9ac69526ad33.jpg 2x" width="4000" height="2667"><img src="https://d1e00ek4ebabms.cloudfront.net/production/4bdcd132-66c1-4e05-afe0-41081ec7c91a.jpg" alt="Jan Kameníček, CEO of Raylyst Solar, a Prague-based distributor of photovoltaic products, stands by a solar panel" data-image-type="image" width="5151" height="3434" loading="lazy"></picture><figcaption class="n-content-picture__caption"><span>Raylyst Solar, a Prague-based distributor of solar panels and other photovoltaic products, tops the FT 1000 ranking of Europe’s fastest-growing companies this year. Chief executive Jan Kameníček is pictured</span><span> </span></figcaption></figure><p>This year’s FT-Statista annual ranking of Europe’s fastest-growing companies refle
@adgad
adgad / adgadblock.txt
Last active October 12, 2019 10:21
adgad-blocker
! 12/10/2019 https://twitter.com
twitter.com##[data-testid="tweet"]:has([href="/adgad"])
twitter.com##article:has([href="/adgad"])
! 12/10/2019 https://github.com
github.com##[id^="issue"]:has(a:has-text(adgad))
github.com##.js-comment:has(a:has-text(adgad))
github.com##.commit-tease:has(a:has-text(adgad))
! 12/10/2019 https://www.instagram.com
@adgad
adgad / adblock-test.js
Created June 2, 2016 12:35
Adblocking Gist
(function() {
//The below is a slightly modified version of https://github.com/sitexw/BlockAdBlock
var BlockAdBlock = function() {
this._options = {
resetOnEnd: true,
loopCheckTime: 50,
loopMaxNumber: 5,
baitClass: 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links',
baitStyle: 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;'
};
@adgad
adgad / SassMeister-input-HTML.html
Created October 13, 2015 09:09
Generated by SassMeister.com.
<nav class="nav">
<ul>
<li class="nav__item">
<a href="#" class="nav__item__link">The Workshop</a>
</li>
<li class="nav__item">
<a href="#" class="nav__item__link">2013 Schedule</a>
</li>
<li class="nav__item nav__item__link--active">
<a href="#" class="nav__item__link">About CSSWizardry</a>
@adgad
adgad / node-dns.md
Last active August 29, 2015 14:27
Notes from playing around with DNS on node
  • Node http uses dns.lookup behind the scenes

  • dns.lookup = uses OS facilities i.e. should be same as ping/wget etc

  • dns.resolve = gets from network, ignores OS config

  • both have options to force IPv4

  • dns.lookup seems to cache (presumably OS cache) i.e. first lookup on app startup slow, after that fast

  • localhost: resolves and lookups all quick. lookup() slightly slower than lookup(...4) (until cache hits)

  • heroku: dns.resolve() a lot quicker than dns.lookup(). markets: lookup slower than lookup(v4), portfolio: lookup and lookup(v4) equally slow.

UPDATE - The reason portfolio lookup(v4) was still slow is because lookup is constrained by a fixed threadpool size. Setting that UV_THREADPOOL_SIZE environment variable to a higher value got the test results back to expected. https://nodejs.org/api/dns.html#dns_implementation_considerations

{
"context": {
"geoIp": {
"country": "FR",
"region": "",
"city": "",
"latitude": 48.86,
"longitude": 2.35
},
"eventTimestamp": "1437050691",
@adgad
adgad / attentionMinutes.js
Last active August 29, 2015 14:04
Attention Minutes
(function () {
var totalAttentionTime = 0,
startAttentionTime,
endAttentionTime,
attentionTimeout,
constantAttentionInterval,
ATTENTION_INTERVAL = 5000,
ATTENTION_EVENTS = ['load', 'click', 'focus', 'scroll', 'mousemove', 'touchstart', 'touchend', 'touchcancel', 'touchleave'],