Skip to content

Instantly share code, notes, and snippets.

Avatar

David Porter bighappyface

View GitHub Profile
@bighappyface
bighappyface / cssRules.js
Created Feb 6, 2017
Javascript for harvesting computed styles on a page
View cssRules.js
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 Jul 12, 2015
TorBrowser Country Exit Node Settings
View tor_country_exit
echo "ExitNodes {US}" >> /Applications/TorBrowser.app/TorBrowser/Data/Tor/torrc
@bighappyface
bighappyface / jenkins-drush-ups.bash
Created Nov 19, 2014
Bash to used for a jenkins job check for drupal and module updates with drush
View jenkins-drush-ups.bash
# prints the list
drush ups
# wraps the same command but to return pass/fail exit code
[ `drush ups --pipe | wc -l` -eq 0 ]
View gist:8450664
cat sometext | jq '.offering.product[].productCharacteristics.productCharacteristic[].name' | sort | uniq | tr "\\n" ","
produces comma-separated list
You can’t perform that action at this time.