Skip to content

Instantly share code, notes, and snippets.

@yaph
yaph / cloudSettings
Last active May 31, 2021 23:09
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-05-31T23:09:01.158Z","extensionVersion":"v3.4.3"}
@yaph
yaph / index.html
Last active October 23, 2019 21:56
d3-geomap label example for stackoverflow.com/questions/58520822
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="https://d3-geomap.github.io/d3-geomap/d3-geomap.css" rel="stylesheet">
<style>
.place-label {
fill: #000;
}
</style>
@yaph
yaph / InstallSelenium.sh
Created November 1, 2016 19:24 — forked from tristandostaler/InstallSelenium.sh
How to install correctly python Selenium (tested on ubuntu gnome)
apt-get install ipython
apt-get install python-pip
pip install selenium
mkdir /root/bin
cd /root/bin
wget https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz
tar -xvzf geckodriver-v0.9.0-linux64.tar.gz
rm geckodriver-v0.9.0-linux64.tar.gz
chmod +x geckodriver
cp geckodriver wires
@yaph
yaph / update-python-envs.sh
Last active August 29, 2015 14:00
Update distribute and all Python virtualenvs in current directory
sudo easy_install -U distribute
find . -type d -maxdepth 1 -exec virtualenv {} \;
@yaph
yaph / vat-reverse
Created April 10, 2014 11:18
Calculate initial amount from final amount for VAT calculation
no_vat = final_amount * 100 / 119
@yaph
yaph / ubuntu-printer-pains.sh
Created April 9, 2014 12:48
Trying to get a Brother DCP-135C to work on Ubuntu 13.10
sudo apt-get purge brother-lpr-drivers-extra
sudo apt-get autoremove
sudo dpkg -i dcp135clpr-1.0.1-1.i386.deb
sudo mkdir ls /var/spool/lpd
sudo dpkg -i dcp135ccupswrapper-1.0.1-1.i386.deb
@yaph
yaph / README.md
Last active August 29, 2015 13:57 — forked from mbostock/.block
Fork of mbostock's coastal counties map

This map shows the graph distance of each county from the Pacific or Atlantic coast; it is a recreation of a map posted to /r/dataisbeautiful using TopoJSON. Coastal counties are dark blue, while counties nine or more counties away from the coast are light yellow. (I opted not to reuse the original’s cycling color scale.)

See also the underlying graph.

@yaph
yaph / arachni-basic-usage.sh
Created January 22, 2014 11:59
Basic arachni usage commands
# scan up to 1000 URLs
arachni --link-count=1000 --report=afr:outfile=domain.tld.html http://domain.tld
# convert existing afr report to html
arachni --repload=domain.tld.afr --report=html:outfile=domain.tld.html
@yaph
yaph / wikicsv.sh
Last active December 30, 2015 15:49
DBpedia/Wikipedia CSV manipulation
# DBpedia table
csvcut -c 2 Film.csv | sed -e 's/(.*)$//' > film-titles.txt
# wikitables CSV
csvcut -c 1 List_of_Academy_Award-winning_films.csv | sed -e 's/(.*)//' | sed -e 's/\"//g' > film-titles.txt
# fix names
sed -e 's/|.*}//g' -e 's/{//' -i datasets/populated-places-locations.csv
@yaph
yaph / ula2json.js
Created October 24, 2013 20:14
Convert an HTML ul list of links to a JSON list of objects with href and text content.
var list = [];
$('ul a').each(function(idx, item){
list.push({
href: $(item).attr('href'),
text: item.textContent
});
});
JSON.stringify(list, null, " ");