Skip to content

Instantly share code, notes, and snippets.

View marcelduran's full-sized avatar

Marcel Duran marcelduran

  • Google Inc.
  • SF Bay Area
View GitHub Profile
@marcelduran
marcelduran / with_cdns.tap
Created August 4, 2014 17:04
YSlow+PhantomJS TAP output for redfin.com
TAP version 13
1..24
ok 1 A (91) overall score
not ok 2 F (48) ynumreq: Make fewer HTTP requests
---
message: This page has 16 external Javascript scripts. Try combining them into one.
...
ok 3 B (80) ycdn: Use a Content Delivery Network (CDN)
---
message: There are 2 static components that are not on CDN. <p>Using these CDN hostnames from your preferences: img.cdn-redfin.com</p>
@marcelduran
marcelduran / markdown.js
Created September 25, 2014 23:47
WebPagetest-API command/options mapping to MarkDown
var map = require('./lib/mapping');
const
TPL_CMD_TITLE = '#### NAME (works for CMDS commandPLURAL)',
TPL_CMD_KEY = '-KEY, ',
TPL_CMD_PARAM = ' _\\<PARAM\\>_',
TPL_CMD_OPT = '* **KEY--NAME**PARAM: INFO';
function caps(word) {
return word[0].toUpperCase() + word.slice(1);
@marcelduran
marcelduran / bookmarklet.js
Last active June 27, 2016 20:43
Fotolog Image Dump
javascript:(function(){var a=document.createElement("iframe"),c=[];a.addEventListener("load",function(){var d=Array.prototype.slice.call(a.contentWindow.document.querySelectorAll(".wall_img_container img"));c=c.concat(d.map(function(a){return a.src}));if((d=Array.prototype.slice.call(a.contentWindow.document.querySelectorAll("#pagination a")).filter(function(a){return"&gt;"==a.innerHTML})[0])&&">"==d.innerText)d.click();else{a.parentNode.removeChild(a);var b=document.createElement("a");document.body.appendChild(b); var e=c.length.toString().length,f=Array(e).fill("0").join("");c.forEach(function(a,c){b.href=a.replace("_t.jpg","_f.jpg");b.innerText=b.download="img_"+(f+c).slice(-e)+".jpg";b.click()});b.parentNode.removeChild(b)}});a.src=location.href;document.body.appendChild(a)})();
@marcelduran
marcelduran / brownnoise.sh
Created September 28, 2017 17:19
Brown background noise
play -q -c 2 -n synth brownnoise gain -35