Data URI manipulation made easy.
This isn't very robust, and will reject a number of valid data URIs. However, it meets the most useful case: a mimetype, a charset, and the base64 flag.
# | |
# Vagrantfile for testing | |
# | |
Vagrant::configure("2") do |config| | |
# the Chef version to use | |
config.omnibus.chef_version = "11.4.4" | |
def configure_vbox_provider(config, name, ip, memory = 384) | |
config.vm.provider :virtualbox do |vbox, override| |
javascript:var d=document,w=window,l=d.location.href;lats=l.indexOf('!2d')+3;late=l.indexOf('!3d',lats);lat=l.substring(lats,late);lngs=l.indexOf('!3d')+3;lnge=l.indexOf('!',lngs);lnge==-1?lnge=l.length:lnge=lnge;lng=l.substring(lngs,lnge);w.location='http://maps.google.com?q='+lng+','+lat; |
""" | |
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ] | |
Modified from remove_output by Minrk | |
""" | |
import sys | |
import io | |
import os | |
from IPython.nbformat.current import read, write |
Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
curl "https://www.wikidata.org/w/api.php?action=wbgetentities&sites=itwiki&titles=Pizza&format=json" | python -mjson.tool | |
{ | |
"entities": { | |
"q177": { | |
"descriptions": { | |
"de": { | |
"language": "de", | |
"value": "Gericht" | |
}, | |
"en": { |
The 'value' is the number of documents. To search for documents within a particular collection: | |
http://api.dp.la/v1/items?isPartOf=Albert%20Gore%20Sr.%20Senate%20Collection | |
{"rows":[ | |
{"key":"Digital Library of Georgia,","value":379}, | |
{"key":"Digital Library of Georgia,\"Integrated in all respects\": Ed Friend's Highlander Folk School films and the politics of segregation","value":8}, | |
{"key":"Digital Library of Georgia,\"Thar's gold in them thar hills\": Gold and gold mining in Georgia, 1830s-1940s","value":174}, | |
{"key":"Digital Library of Georgia,1968 sanitation workers strike","value":150}, | |
{"key":"Digital Library of Georgia,A Thousand wheels are set in motion: the buildings of Georgia Tech at the turn of the 20th century, 1888-1908","value":2}, |
//------------------------------------------------------------- | |
// | |
// Hypothesis: | |
// | |
// Promises/A is a Monad | |
// | |
// To be a Monad, it must provide at least: | |
// - A unit (aka return or mreturn) operation that creates a corresponding | |
// monadic value from a non-monadic value. | |
// - A bind operation that applies a function to a monadic value |
{ | |
"meta":{ | |
"limit":20, | |
"logged_in_username":null, | |
"next":null, | |
"offset":0, | |
"previous":null, | |
"total_count":6 | |
}, | |
"objects":[ |