Skip to content

Instantly share code, notes, and snippets.

View dbpedia docker
docker run -tid \
--restart unless-stopped \
--name dbpedia-spotlight.en \
--mount source=spotlight-models,target=/opt/spotlight \
-p 2222:80 \
dbpedia/dbpedia-spotlight \ en
johnschimmel / inTheLifeMediaSearch.php
Created Nov 7, 2011
PHP SOAP request using CURL to retrieve In The Life Station listings
View inTheLifeMediaSearch.php
function getListingsViaSoap($zipcode) {
$url = "";
$soap_request = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<InTheLife xmlns="">
johnschimmel / index.html
Last active Sep 4, 2021
Demo of loading Google Maps, fetching Markers with AJAX, Geocoding new location and POSTing new location with AJAX.
View index.html
/* IMPORTANT - must give map div height */
#map-canvas {
/* IMPORTANT - fixes webkit infoWindow rendering */
#map-canvas img {
max-width: none;
johnschimmel /
Created Nov 6, 2012
Sample Flask route to create JSON from Dictionary
from flask import jsonify
def data_ideas():
# query for the ideas - return oldest first, limit 10
ideas = models.Idea.objects().order_by('+timestamp').limit(10)
if ideas:
johnschimmel /
Created May 21, 2021
ffmpeg embed srt caption
ffmpeg -i funtime.mp4 -f srt -i -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng funtime_w_captions.mp4
johnschimmel /
Created Oct 25, 2012
Sample of Flask receiving JSON
# If /json route receives header "application/json"
@app.route("/json", methods=['GET','POST'])
def json():
app.logger.debug("JSON received...")
if request.json:
mydata = request.json # will be
johnschimmel /
Created Oct 21, 2012
Dictionary in dictionary to Jinja2 example
# put this in your
def nutbutter():
# nuts and review
nuttbutterReviews = {
'almond' : 'great',
'peanut' : 'okay',
'walnut' : 'what is this stuff?'
johnschimmel / server_simple.js
Created Feb 7, 2012
Simple NodeJS web server example
View server_simple.js
creates a simple web server that
display "Hello Dynamic World Wide Web"
1) from terminal run 'node simple_server.js'
johnschimmel /
Last active Jan 8, 2019
Download flickr favorites
import flickrapi
import urllib.request
import os.path
import json
# Make it work for Python 2+3 and with Unicode
import io
to_unicode = unicode
except NameError:
johnschimmel / googleDocsAPI
Created Dec 22, 2011
Google Docs API + PHP + ClientLogin example
View googleDocsAPI
// Example of how to log into Google API with ClientLogin, good to use when you're not making a webapp.
// code taken and minimally updated from
// Construct an HTTP POST request
$clientlogin_url = "";
$clientlogin_post = array(
"accountType" => "HOSTED_OR_GOOGLE",
"Email" => "",