When a user hits Gitcoin, they're immediately bombarded by townsquare and a navigation bar up top that indiscriminately introduces them to the whole product suite of Gitcoin. New folks find this confusing, and returning users have to dig through a dropdown list or URLs in order to find where they're going. From the Gitcoin operator side, we have no idea what that user is on the site for, and serving an entire buffet of products lengthens the "time to value" for a particular user.
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
// from https://twitter.com/Steve8708/status/1504131981444980739 | |
// simplified to a function body of 8 tidy lines | |
// no loop needed, no 2d array of 3-tuples needed | |
// just 2 arrays, a findIndex call, and some indexing :) | |
export function getRelativeTimeString( | |
date: Date | number, | |
lang = "en" | |
): string { | |
const timeMs = typeof date === "number" ? date : date.getTime(); |
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 minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
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 EIP712Domain from "eth-typed-data"; | |
import BigNumber from "bignumber.js"; | |
import * as ethUtil from 'ethereumjs-util'; | |
import { ethers } from "ethers"; | |
import axios from "axios"; | |
/* | |
* Safe relay service example | |
* * * * * * * * * * * * * * * * * * * */ |
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 Parser = require('rss-parser'); | |
const parseVolumeToInt = volume => { | |
const vol = volume.replace('+', '').replace(',', ''); | |
return Number.parseInt(vol, 10); | |
}; | |
async function getGoogleTrends(url) { | |
const parser = new Parser({ | |
defaultRSS: 2.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
import EXIF from 'exif-js'; | |
const hasBlobConstructor = typeof (Blob) !== 'undefined' && (function checkBlobConstructor() { | |
try { | |
return Boolean(new Blob()); | |
} catch (error) { | |
return false; | |
} | |
}()); |
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
/* | |
Hoje iremos MUDAR a vida da pessoa que não te responde no whatsappp... | |
Que tal enviar mensagens pra ela até obter uma resposta?! | |
Sensacional não acha?! Mas, somos devs, correto?! Então vamos automatizar esse paranauê! | |
Para utilizar: | |
- Abra o web.whatsapp.com; | |
- Selecione a conversa que você quer; | |
- Abra o console e cole o código que está no gist; |
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 AWS = require("aws-sdk"); // from AWS SDK | |
const fs = require("fs"); // from node.js | |
const path = require("path"); // from node.js | |
// configuration | |
const config = { | |
s3BucketName: 'your.s3.bucket.name', | |
folderPath: '../dist' // path relative script's location | |
}; |
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
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice | |
stun: | |
stun.l.google.com:19302, | |
stun1.l.google.com:19302, | |
stun2.l.google.com:19302, | |
stun3.l.google.com:19302, | |
stun4.l.google.com:19302, | |
stun.ekiga.net, | |
stun.ideasip.com, |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
NewerOlder