Skip to content

Instantly share code, notes, and snippets.

@kylemcdonald
kylemcdonald / Collect Parler Metadata.ipynb
Last active September 20, 2023 11:45
Collect video URLs and GPS data for Parler videos.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashlynnpai
ashlynnpai / index.html
Created September 14, 2017 14:55
Wikipedia API viewer
<body>
<input id="startSearch" type="text">
<button onClick="getEntries()">Search Wikipedia</button>
<div>
<button onClick="getRandom()">Get Random Entry</button>
</div>
<div id="showResults">
</div>
</body>
@codediodeio
codediodeio / database.rules.json
Last active January 28, 2024 19:07
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@bdkent
bdkent / createFullWidthMasonry.jsx
Last active February 10, 2019 21:46
react-virtualized <AutoSizer> + <Masonry>
var DEFAULT_CELL_HEIGHT = 250;
var DEFAULT_CELL_SPACING = 10;
function createFullWidthMasonry(props) {
var cellSpacing = props.cellSpacing || DEFAULT_CELL_SPACING;
var cellHeight = props.cellHeight || DEFAULT_CELL_HEIGHT;
var keyMapper = props.keyMapper || _.identity();
@bschwartz757
bschwartz757 / async.js
Last active November 15, 2023 03:23
Async/await function to fetch data from multiple URLs in parallel
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/
async function fetchURLs() {
try {
// Promise.all() lets us coalesce multiple promises into a single super-promise
var data = await Promise.all([
/* Alternatively store each in an array */
// var [x, y, z] = await Promise.all([
// parse results as json; fetch data response has several reader methods available:
//.arrayBuffer()
@cvan
cvan / google-sheets-sync-to-firebase.js
Last active March 23, 2020 18:05
Google Spreadsheets script for syncing to Firebase
function syncToFirebase () {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var numCols = rows.getNumColumns();
var values = rows.getValues();
var output = [];
var sheetName = sheet.getName();
@addyosmani
addyosmani / headless.md
Last active May 7, 2024 12:36
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.