Skip to content

Instantly share code, notes, and snippets.

@michaelbrooks
michaelbrooks / .bash_virtualenvwrapper.sh
Last active February 2, 2019 13:51
.bashrc to enable virtualenvwrapper for MinGW bash shells
# If you are using a MinGW environment
# such as that provided by the bash shell included
# with GitHub for Windows, this script will
# make sure you have the necessary tools installed
# to run virtualenvwrapper.
#
# You can add the following to your .bashrc file to automatically
# download and run this gist when you start your shell:
#
# if [ ! -e $HOME/.bash_virtualenvwrapper.sh ]; then
@michaelbrooks
michaelbrooks / twitter_scraper.js
Last active August 29, 2015 14:00
JavaScript that scrapes tweet data from a page on twitter.com
(function () {
//Extract latitude and longitude if possible.
var geo_reg = /(-?\d+.?\d*),(-?\d+.?\d*)/;
var get_geo = function(tweet) {
var geo = tweet.find('.tweet-geo-text a').attr('href');
if (geo) {
geo = decodeURIComponent(geo);
geo = geo_reg.exec(geo);
if (geo) {
return {
@michaelbrooks
michaelbrooks / ie10-viewport-fix.css
Created October 2, 2014 08:38
IE 10 viewport device width fix
/*
Fix for IE10 device width.
http://timkadlec.com/2013/01/windows-phone-8-and-device-width/
*/
@-webkit-viewport{width:device-width}
@-moz-viewport{width:device-width}
@-ms-viewport{width:device-width}
@-o-viewport{width:device-width}
@viewport{width:device-width}