Skip to content

Instantly share code, notes, and snippets.

@bergonzzi
bergonzzi / index.html
Last active July 21, 2021 13:37
DataTables + yadcf + maplace.js - load the table and the map from the same data source and update the map automatically when filtering
<html>
<head>
<title>DataTables + yadcf + Google Maps</title>
<script type="text/javascript" charset="utf8" src="http://maps.google.com/maps/api/js?libraries=geometry&v=3.22&key={YOUR_API_KEY}"></script>
<script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" charset="utf8" src="http://cdn.datatables.net/1.10.11/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.11/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" charset="utf8" src="maplace.min.js"></script>
<script type="text/javascript" charset="utf8" src="jquery.dataTables.yadcf.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
@bergonzzi
bergonzzi / tidy_xml_lint.py
Created December 15, 2013 19:27
Format XML in Sublime Text 2 (OS X)
import sublime, sublime_plugin, subprocess
class TidyXmlLintCommand(sublime_plugin.TextCommand):
def run(self, edit):
command = "XMLLINT_INDENT=$'\t' xmllint --format --encode utf-8 -"
# help from http://www.sublimetext.com/forum/viewtopic.php?f=2&p=12451
xmlRegion = sublime.Region(0, self.view.size())
p = subprocess.Popen(command, bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
result, err = p.communicate(self.view.substr(self.view.sel()[0]).encode('utf-8'))