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
#!/usr/bin/env node | |
const doc = "Usage: ./run-bot.js [options] Options: -u --url=<url> URL -o --host=<host> Hubs host if URL is not specified [default: localhost:8080] -r --room=<room> Room id -h --help Show this screen"; | |
const docopt = require("docopt").docopt; | |
const options = docopt(doc); | |
const puppeteer = require("puppeteer"); | |
const querystring = require("query-string"); | |
(async () => { |
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
// cssreload.js | |
// https://github.com/bgrins/devtools-snippets | |
// Removes then reloads all the CSS files in the current page | |
(function () { | |
function insertAfter(newElement, targetElement) { | |
var parent = targetElement.parentNode; | |
if (parent.lastChild == targetElement) { | |
parent.appendChild(newElement); | |
} else { |
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
let p = (v) => { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, 1000) | |
}).then(() => v) | |
} | |
[1, 2, 3, 4, 5].reduce((seq, curr) => { | |
return seq.then(() => p(curr)).then(console.log) | |
}, Promise.resolve()) |
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 adjectives = [ 'able', 'absolute', 'acceptable', 'acclaimed', 'accomplished', 'accurate', 'aching', 'acrobatic', 'adorable', 'adventurous', 'basic', 'belated', 'beloved', 'calm', 'candid', 'capital', 'carefree', 'caring', 'cautious', 'celebrated', 'charming', 'daring', 'darling', 'dearest', 'each', 'eager', 'early', 'earnest', 'easy', 'easygoing', 'ecstatic', 'edible', 'fabulous', 'fair', 'faithful', 'familiar', 'famous', 'fancy', 'fantastic', 'far', 'generous', 'gentle', 'genuine', 'giant', 'handmade', 'handsome', 'handy', 'happy', 'icy', 'ideal', 'identical', 'keen', 'lasting', 'lavish', 'magnificent', 'majestic', 'mammoth', 'marvelous', 'natural', 'obedient', 'palatable', 'parched', 'passionate', 'pastel', 'peaceful', 'perfect', 'perfumed', 'quaint', 'qualified', 'radiant', 'rapid', 'rare', 'safe', 'sandy', 'satisfied', 'scaly', 'scarce', 'scared', 'scary', 'scented', 'scientific', 'secret', 'sentimental', 'talkative', 'tangible', 'tart', 'tasty', 'tattered', 'teeming', 'ultimate', 'uncommon', 'uncon |
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
// Must install ImageMagick first | |
http://www.imagemagick.org/script/index.php | |
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg | |
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg | |
// This does the same as above but to an entire folder (will overwrite original files): | |
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg | |
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files) |
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
// geo-location shim | |
// currentely only serves lat/long | |
;(function(geolocation){ | |
if (geolocation) return; | |
var cache; | |
geolocation = window.navigator.geolocation = {}; |
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
@keyframes donut-spin { | |
0% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
.donut { | |
display: inline-block; |
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
fetch('/api/v2/person/trending').then(function(data) { | |
return data.json(); | |
}).then(function(jsonData) { | |
console.log(jsonData); | |
}).catch(function(e) { | |
alert('There was a problem with the request'); | |
}) |
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
// paste in console on safari reader lmao | |
(function(d) { | |
var s = d.createElement('style'); | |
var c = '#background{background:#f773b5 url(https://i.imgur.com/bB7aD.jpg)}h1.title,.page{font-family:"Comic Sans MS"!important}'; | |
c += 'h1.title{color:#f773b5}.page{background:rgba(255,255,255,.9);-webkit-animation-name:f;-webkit-animation-duration:5s;'; | |
c += '-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear}@-webkit-keyframes f{'; | |
c += '0%{-webkit-transform:rotate(0) scale(1)}25%{-webkit-transform:rotate(-4deg) scale(.95)}50%{-webkit-transform:rotate(0) scale(1)}'; | |
c += '75%{-webkit-transform:rotate(4deg) scale(.95)}100%{-webkit-transform:rotate(0) scale(1)}}'; | |
s.appendChild(d.createTextNode(c)); | |
d.head.appendChild(s) |
OlderNewer