Skip to content

Instantly share code, notes, and snippets.

View sivcan's full-sized avatar
:electron:

Sivcan Singh sivcan

:electron:
View GitHub Profile
@sivcan
sivcan / airtablescrape.js
Last active June 18, 2022 10:25
Airtable scraper script (DevTools)
let columns = temp1.table.columns,
identifiers = {
'Company name': 'name',
'City': 'city',
'Where to apply': 'url',
'Status': 'status'
};
function getData (row) {
return _.reduce(columns, (acc, column) => {
@sivcan
sivcan / script.js
Created May 23, 2020 22:33
Scrape Airtable [Script]
/**
1. Observed the Network tab in chrome devtools
2. Found out the request that has all the data
3. Right click the data (response of the network request) -> Store as global variable (this basically makes the entire data
available in the Console of DevTools) - it’s stored under a variable called as temp1
3. Figured out by writing _.VERSION in the console that Lodash library was available, so I can use that to convert my data.
4. Observed the payload, figured out how columnIds are mapped to the data that is present in the entire response JSON.
5. Wrote the following scripts to access the data:
**/
@sivcan
sivcan / NextPropsDiff.js
Created March 7, 2018 11:30
React utility for nextProps diff (Shallow check)
// Use it with the componentWillReceiveProps lifecycle method
//
// componentWillReceiveProps(nextProps) {
// shallowEqual(this.props, nextProps);
// }
//
function shallowEqual(objA, objB) {
if (is(objA, objB)) return true