Skip to content

Instantly share code, notes, and snippets.

View saylestyler's full-sized avatar
🥰
= )

Tyler Sayles saylestyler

🥰
= )
View GitHub Profile
#!/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 () => {
// 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 {
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())
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
@saylestyler
saylestyler / imageMagick
Last active May 17, 2019 18:52
#imagemagick #util
// 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)
// geo-location shim
// currentely only serves lat/long
;(function(geolocation){
if (geolocation) return;
var cache;
geolocation = window.navigator.geolocation = {};
@keyframes donut-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.donut {
display: inline-block;
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');
})
@saylestyler
saylestyler / newsletter.html
Created August 3, 2018 16:09
newsletter.html
<div class="our-class" style="
background-image: linear-gradient(-225deg, #231557 0%, #44107A 29%, #FF1361 67%, #FFF800 100%);
">
<h2 style="color: white"> ¡CUIDADO PISO MOJADO!</h2>
<br />
<iframe src="https://giphy.com/embed/11WMKf3NiYSxAQ" width="320" height="480" frameborder="0" class="giphy-embed"></iframe>
<p><a href="https://giphy.com/gifs/asap-rocky-11WMKf3NiYSxAQ">via GIPHY</a></p>
<h2 style="color: white">
if u notice some functionality missing <br />from this template editor:
<br /><br /> fax me to inject an <br />&quot;HTML EXPERTS ONLY&quot; snippet <br /><br />
@saylestyler
saylestyler / bounce.js
Created August 13, 2018 21:56
bouncey pg
// 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)