This file contains hidden or 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
data | |
.filter(x => (new Date(x.dt_iso)).getMonth() > 5 && (new Date(x.dt_iso)).getMonth() < 8) | |
.reduce((acc, x) => { | |
const h = (new Date(x.dt_iso)).getHours(); | |
return acc.hasOwnProperty(h) ? | |
Object.assign({}, acc, { [h]: acc[h] + x.clouds.all }) : | |
Object.assign({}, acc, { [h]: x.clouds.all }) | |
}, {}); |
This file contains hidden or 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
window.setInterval(() => document.querySelector('input[value="Move to Cart"]').click(), 250); |
This file contains hidden or 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 request = require('superagent'); | |
const username = 'liddiard'; // change username as needed | |
request | |
.get(`https://api.github.com/users/${username}/repos`) | |
.query({page: 1}) // increment this page number as needed | |
.then(res => | |
fs.appendFile('repos.txt', res.body.map(repo => | |
[repo.name, repo.html_url, repo.description].join('\n')) |
This file contains hidden or 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
function linkReport(selector) { | |
'use strict'; | |
const fetchOptions = { | |
method: 'HEAD' | |
}; | |
window.brokenLinks = []; | |
document | |
.querySelectorAll(selector) | |
.forEach(link => { | |
fetch(link.href) |
This file contains hidden or 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
Array.from(document.querySelectorAll('.fsl.fwb.fcb > a')).map(link => link.text).sort().join('\n'); |
This file contains hidden or 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
(function(){ | |
document.body.style.width = '100vw'; | |
document.documentElement.style.width = '100vw'; | |
document.body.style.height = '100vh'; | |
document.documentElement.style.height = '100vh'; | |
document.body.style.overflow = 'scroll'; | |
document.documentElement.style.overflow = 'scroll'; | |
window.addEventListener("deviceorientation", event => { |
This file contains hidden or 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
#!/bin/bash | |
networksetup -setairportpower en0 off | |
sleep 1 | |
networksetup -setairportpower en0 on |
This file contains hidden or 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
// click the "more members" button programatically to get everyone who likes dank memes | |
window.setInterval(() => { document.querySelector('.uiMorePagerPrimary').click() }, 5000); | |
// get the names of everyone who likes dank memes | |
let people = Array | |
.from(document.querySelectorAll('.fsl.fwb.fcb')) | |
.map(a => { return a.innerText }); | |
// get the 100x100 profile photo URLs of everyone who likes dank memes | |
let photos = Array |
This file contains hidden or 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
(function(){ | |
// get a reference to the current script (IE support) | |
// http://stackoverflow.com/a/22745553 | |
const scripts = document.getElementsByTagName('script'); | |
const currentScript = scripts[ scripts.length - 1 ]; | |
const CONTEXT_URL = currentScript.dataset.context; | |
const TEMPLATE_URL = currentScript.dataset.template; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link href="favicon.ico" rel="icon" type="image/x-icon" /> | |
<title>Thoughtpad</title> | |
<meta name="description" content="Page description, shows up in search results. Should be no longer than 150-160 characters." /> |