Skip to content

Instantly share code, notes, and snippets.

"""
Utility script to visualize embeddings using the tensorboard projector module.
Usage
-----
Dependencies : numpy, pillow, pandas, tensorflow
Call `prepare_projection(embedding, metadata, image_paths, ...)`, where :
- `embedding` is a 2D numpy array (`n_sample` x `dim_embedding`)
@eyeNsky
eyeNsky / mapnik-rotate
Last active November 27, 2018 21:55
rotate mapnik output map
Mapnik supports the PROJ.4 WKT for projections and buried deep in the doc's is one called
'Two Point Equidistant'. You provide the left and right points and the map is rotated
such that these two points are horizontal in the output.
This allows you to rotate the map to any angle (including south up!!) and the text is
rendered correctly! You don't have to change the projections of your input vectors.
Simply tweak the mapnik generate_image.py script like this:
Change:
@davej
davej / delete_all_tweets.py
Last active August 12, 2024 16:20
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script will delete all of the tweets in the specified account.
You may need to hit the "more" button on the bottom of your twitter profile
page every now and then as the script runs, this is due to a bug in twitter.
You will need to get a consumer key and consumer secret token to use this
script, you can do so by registering a twitter application at https://dev.twitter.com/apps
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1)