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
// 1. Paste the first script into the console | |
// 2. Slowly resize the browser window, covering full range | |
// 3. Paste the second script into the console | |
// This could probably be a browser extension that overlays the data on each image... | |
// SCRIPT ONE | |
// breakpoint values that we want to calculate `sizes` for |
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
GRAVITY TEST | |
# BITSY VERSION 6.4 | |
! ROOM_FORMAT 1 | |
PAL 0 | |
0,82,204 | |
128,159,255 | |
255,255,255 |
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
// for use on https://bandcamp.com/download pages. | |
// once all the download links on the page are loaded, | |
// open the javascript console, paste the following code in, and hit enter. | |
// leave the page open until the downloads stop, | |
// it'll pause for 30 seconds after every click to ensure the last download has started already. | |
var secs = 30; // adjust as needed for slower connections. | |
var intervalTime = secs * 1000 | |
var toDownload = [].slice.call(document.querySelectorAll('.downloads a.item-button')); | |
var interval; |
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
<script> | |
var the_path_to_your_sound_file = "surf.mp3" | |
var context = new AudioContext(); | |
var playSound = context.createBufferSource(); | |
var getSound = new XMLHttpRequest(); | |
getSound.open("GET", the_path_to_your_sound_file, true); | |
getSound.responseType = "arraybuffer"; | |
getSound.onload = function() { | |
context.decodeAudioData(getSound.response, function(buffer){ | |
playSound.buffer = buffer; |
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
request('http://lyrics.wikia.com/LyricWiki:Top_100', function (error, response, html) { | |
if (!error && response.statusCode == 200) { | |
var $ = cheerio.load(html); | |
//handle the 'page not found' page? | |
$('li b a').each(function(i, element){ | |
pages.push('http://lyrics.wikia.com' + $(element).attr('href')) | |
// | |
}); | |
console.log(pages) |
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
youtube-dl -o "input" https://www.youtube.com/watch?v=someurl && ffmpeg -i input.mp4 output.mp3 |
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
function isProbablyAMeme(ctx2, w, h) { | |
// given a ctx, get it's pixel data | |
var pixels = ctx2.getImageData(0, 0, w, h) | |
// threshhold filter the pixels. looking for bright white a la bold impact meme text | |
for (var i = 0; i < pixels.data.length; i += 4) { | |
var avg = (pixels.data[i] + pixels.data[i + 1] + pixels.data[i + 2]) / 3 | |
var ne = avg > 240 ? 0 : 255 | |
pixels.data[i] = ne | |
pixels.data[i + 1] = ne |
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
var config = require({CONFIG_IN_THE_TTEZEL/TWIT_MODULE_STYLE}) | |
var Twit = require('twit') | |
var T = new Twit(config) | |
var fs = require('fs') | |
var uname = 'YR-TWITTER-USERNAME' | |
var listSlug = 'THE-SLUG-TO-YR-BOT-LIST' | |
var theInterval = 5000 | |
// Requests / 15-min window (user auth) // 180 | |
// if yr list has > 180 members, uhhhhh increase theInterval so that it doesn't break 180 in 15 minutes? |
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
var http = require("http") | |
var url = require("url") | |
var MemJS = require("memjs").Client | |
memjs = MemJS.create(); | |
var server = http.createServer(function (req, res) { | |
var name = url.parse(req.url).pathname.substr(1) | |
if(!!name) { | |
doThatThang(name, function (html) { | |
res.writeHead(200, {"Content-Type": 'text/html', 'Content-Length': html.length}); | |
res.end(html); |
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
var config = require('./config') // yr api keys and stuff | |
var Twit = require('twit') | |
var T = new Twit(config) | |
var fs = require('fs') | |
var $ = require('cheerio') | |
var request = require('request') | |
function doThatThang (link, type) { | |
request(link, function (err, resp, html) { | |
if (err) return console.error(err) |
NewerOlder