This file contains 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
"use strict"; | |
const fs = require("fs"); | |
const jwt = require("jsonwebtoken"); | |
const privateKey = fs.readFileSync("AuthKey.p8").toString(); | |
const teamId = "ABCDE12345"; | |
const keyId = "ABCDE12345"; | |
const jwtToken = jwt.sign({}, privateKey, { |
This file contains 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
# In order to run this, you will need to get Twitter API access and set environment variables for the following: | |
# - TWITTER_CONSUMER_KEY | |
# - TWITTER_CONSUMER_SECRET | |
# - TWITTER_ACCESS_TOKEN | |
# - TWITTER_ACCESS_TOKEN_SECRET | |
# | |
# Then, update TWITTER_ID below with your Twitter ID. This is a string of numbers | |
# you can look up with http://gettwitterid.com/. | |
# | |
# You will also need to `pip install tweepy`. |
This file contains 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 hrefs = []; | |
setInterval(function() { | |
const timestamps = [...document.getElementsByTagName("time")]; | |
timestamps.forEach(timestamp => { | |
if (timestamp.parentNode.href) { | |
const tweetId = timestamp.parentNode.href.split("/").pop(); | |
hrefs.push(tweetId); | |
}; | |
}); |
This file contains 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 transform = (file, api) => { | |
// Alias the jscodeshift API for ease of use. | |
const j = api.jscodeshift; | |
// Convert the entire file source into a collection of nodes paths. | |
const root = j(file.source); | |
const LAST_IMPORT = root.find(j.ImportDeclaration).at(-1); | |
const blogPageProps = [ |
This file contains 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 | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
This file contains 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
// Copy and paste all of this into the console on a page that contains tweets to | |
// start collecting. Run `stopCrawlAndGenerateList()` once you've collected enough | |
// tweets. | |
// Instantiating raw array of tweets. | |
const allTweetsById = []; | |
// Common "words" to filter out based on 4 Twitter accounts' likes. | |
const commonWords = ["Chris","got","of","all","my","on","just","I’ll","have","to","make","a","list","the","little","I","but","also","happy","any","about","are","take","|","for","and","is","built","with","KBLoad","·","day","here","at","long","The","in","it","or","hope","you","enjoy","(and","if","this","been","working","hard","get","when","Williams","2","","ever","not","like","Maybe","some","When","learned","never","even","No","one","other","it,","It's","better","stop","break","than","10","bad","things","be","people","asked","me","try","image73","open","give","If","loving","go","your","new","Show","years","ago","joined","A","lot","more","Just","Matt","Dave","New","It","My","latest","made","Today","first","as |
This file contains 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
// Run per page. You will have to hover over some posters before running to ensure `.icon-watched` is rendered. | |
const watchedActionButtons = [...document.querySelectorAll(".icon-watched")] | |
for (watchedActionButtonIndex = 0; watchedActionButtonIndex < watchedActionButtons.length; watchedActionButtonIndex++) { | |
watchedActionButtons[watchedActionButtonIndex].click() | |
console.log("Deleted movie at index #" + watchedActionButtonIndex + ".") | |
} |
This file contains 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 recordedSpeeds = [] | |
setInterval(() => { | |
// Get internet speed | |
let speed = document.getElementById('speed-value').innerText | |
// Get speed units | |
const units = document.getElementById('speed-units').innerText | |
// Flatten speed if Kbps | |
if (units === 'Kbps') speed = "0" | |
// Display in console | |
console.log('='.repeat(Number(speed) / 5), speed) |
This file contains 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
[ | |
{ | |
"year":"2017", | |
"films":[ | |
{ | |
"title":"Coco", | |
"rating":82, | |
"box_office":208831333 | |
}, | |
{ |
This file contains 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
// get data from Parse for interactions | |
var Interactions = Parse.Object.extend("Interactions"); | |
var intsquery = new Parse.Query(Interactions).limit(1000); | |
var interactions = []; | |
intsquery.find({ | |
success: function(ints) { | |
console.log("Successfully retrieved " + ints.length + " interactions."); | |
// create interactions array from Interactions in Parse | |
for (var i in ints) { | |
int = ints[i]; |
NewerOlder