Skip to content

Instantly share code, notes, and snippets.

View ganapativs's full-sized avatar
๐ŸŽฏ
Focusing

Ganapati V S ganapativs

๐ŸŽฏ
Focusing
View GitHub Profile

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@surma
surma / package.json
Created April 18, 2018 15:07
Boilerplate for quick one-off TypeScript projects. Just run `npm start`
{
"name": "tsquickstart",
"version": "1.0.0",
"description": "Boilerplate for quick one-off TypeScript projects. Just run `npm start`",
"scripts": {
"init": "test -f tsconfig.json || (tsc --init -t ESNext -m ESNext && npm install)",
"start": "npm run init && concurrently \"npm run watch\" \"npm run serve\"",
"serve": "http-server",
"watch": "tsc -p . --watch",
"build": "tsc -p ."
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@DmytroLisitsyn
DmytroLisitsyn / country_dial_info.json
Last active April 9, 2025 10:57 — forked from Goles/CountryCodes.json
A JSON dataset of entities containing country name, code, dial (phone) code and flag emoji icon.
[{"name":"Afghanistan","flag":"๐Ÿ‡ฆ๐Ÿ‡ซ","code":"AF","dial_code":"+93"},{"name":"ร…land Islands","flag":"๐Ÿ‡ฆ๐Ÿ‡ฝ","code":"AX","dial_code":"+358"},{"name":"Albania","flag":"๐Ÿ‡ฆ๐Ÿ‡ฑ","code":"AL","dial_code":"+355"},{"name":"Algeria","flag":"๐Ÿ‡ฉ๐Ÿ‡ฟ","code":"DZ","dial_code":"+213"},{"name":"American Samoa","flag":"๐Ÿ‡ฆ๐Ÿ‡ธ","code":"AS","dial_code":"+1684"},{"name":"Andorra","flag":"๐Ÿ‡ฆ๐Ÿ‡ฉ","code":"AD","dial_code":"+376"},{"name":"Angola","flag":"๐Ÿ‡ฆ๐Ÿ‡ด","code":"AO","dial_code":"+244"},{"name":"Anguilla","flag":"๐Ÿ‡ฆ๐Ÿ‡ฎ","code":"AI","dial_code":"+1264"},{"name":"Antarctica","flag":"๐Ÿ‡ฆ๐Ÿ‡ถ","code":"AQ","dial_code":"+672"},{"name":"Antigua and Barbuda","flag":"๐Ÿ‡ฆ๐Ÿ‡ฌ","code":"AG","dial_code":"+1268"},{"name":"Argentina","flag":"๐Ÿ‡ฆ๐Ÿ‡ท","code":"AR","dial_code":"+54"},{"name":"Armenia","flag":"๐Ÿ‡ฆ๐Ÿ‡ฒ","code":"AM","dial_code":"+374"},{"name":"Aruba","flag":"๐Ÿ‡ฆ๐Ÿ‡ผ","code":"AW","dial_code":"+297"},{"name":"Australia","flag":"๐Ÿ‡ฆ๐Ÿ‡บ","code":"AU","dial_code":"+61"},{"name":"Austria","flag":"๐Ÿ‡ฆ๐Ÿ‡น","code":"AT","dial_code":"+43"},{"name":"Azerbaijan","flag":"๐Ÿ‡ฆ๐Ÿ‡ฟ","code":"AZ","dial_code":"+9
@mort3za
mort3za / git-auto-sign-commits.sh
Last active February 5, 2025 18:58
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@mattlockyer
mattlockyer / client.js
Last active February 22, 2023 18:30
s3 upload as stream using req stream (extra info in request header)
const file = this.input.files[0];
//console.log(file);
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', (e) => {
console.log(e.target.response);
});
xhr.open('POST', host + 'fileuploadstream', true);
xhr.setRequestHeader('body', JSON.stringify({ id: 'somebucketfolderid', fn: file.name }));
xhr.send(file);

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@Rich-Harris
Rich-Harris / service-workers.md
Last active May 3, 2025 12:49
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time โ€“ suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@dahjelle
dahjelle / pre-commit.sh
Created July 13, 2016 16:48
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done