Skip to content

Instantly share code, notes, and snippets.

@vitorbal
vitorbal / README.md
Last active February 9, 2022 18:02
jscodeshift transform to add metadata to all ESLint rules

jscodeshift transform to add metadata to all ESLint rules

This transform was created to programmatically add metadata to all ESLint rules (#5417).

here's a live example for the no-trailing-spaces rule.

Please note:

  • The rule mappings were initially created by scraping eslint.org/docs/rules using jsdom.
  • The scraping assumes all fixable rules are of fixable type whitespace. This is not true for 4 rules, which were fixed manually afterwards:
    • semi
  • no-extra-semi
module.exports = {
'plugins': ['flowtype', 'prettier'],
"globals": {
"window": true
},
'rules': {
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
@taseppa
taseppa / gist:66fc7239c66ef285ecb28b400b556938
Last active May 1, 2023 21:09
Getting your Tinder access token and facebook id

Getting access token

Enable developer console in browser and navigate to:

https://www.facebook.com/v2.6/dialog/oauth?redirect_uri=fb464891386855067%3A%2F%2Fauthorize%2F&scope=user_birthday%2Cuser_photos%2Cuser_education_history%2Cemail%2Cuser_relationship_details%2Cuser_friends%2Cuser_work_history%2Cuser_likes&response_type=token%2Csigned_request&client_id=464891386855067&ret=login&fallback_redirect_uri=221e1158-f2e9-1452-1a05-8983f99f7d6e&ext=1556057433&hash=Aea6jWwMP_tDMQ9y

Look for the response of POST request in the network tab of developer console: https://www.facebook.com/v2.6/dialog/oauth/confirm?dpr=1 it contains the access token parameter. Just search for 'access_token' in the response. For the lazy people (like myself) i made a small helper that parses the token from response https://taseppa.github.io/tokenparser.github.io/

Getting facebook id

@lixiaoyan
lixiaoyan / entry.js
Last active June 28, 2019 20:33
React 16: ReactDOM.hydrate(...)
import React from "react";
import ReactDOM from "react-dom";
import { AppContainer } from "react-hot-loader";
import App from "./App";
const render = (hydrate = false) => {
const container = document.querySelector("#app");
const element = (
<AppContainer>