Skip to content

Instantly share code, notes, and snippets.

View bighappyface's full-sized avatar
🙂

David Porter bighappyface

🙂
View GitHub Profile
@bighappyface
bighappyface / cssRules.js
Created February 6, 2017 02:22
Javascript for harvesting computed styles on a page
var cssRules = function(){
var filter = Array.prototype.filter;
var map = Array.prototype.map;
var rules = map.call(document.querySelectorAll('*'), function(element){
return element.ownerDocument.defaultView.getMatchedCSSRules(element,'');
});
var items = rules.map(function(list){
list = list || [];
return map.call(list, function(rule){
@bighappyface
bighappyface / tor_country_exit
Created July 12, 2015 03:59
TorBrowser Country Exit Node Settings
echo "ExitNodes {US}" >> /Applications/TorBrowser.app/TorBrowser/Data/Tor/torrc
@bighappyface
bighappyface / jenkins-drush-ups.bash
Created November 19, 2014 20:04
Bash to used for a jenkins job check for drupal and module updates with drush
# prints the list
drush ups
# wraps the same command but to return pass/fail exit code
[ `drush ups --pipe | wc -l` -eq 0 ]
cat sometext | jq '.offering.product[].productCharacteristics.productCharacteristic[].name' | sort | uniq | tr "\\n" ","
produces comma-separated list