Skip to content

Instantly share code, notes, and snippets.

@maxim75
maxim75 / upload.html
Created June 2, 2011 03:33
File upload with HTML5 FileAPI
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
</head>
<body>
<ul id="file-list"></ul>
<p>
<input id="files-upload" type="file" multiple>
</p>
@maxim75
maxim75 / gist:1000135
Created May 31, 2011 08:02
GPX parsing with JavaScript
<!DOCTYPE html>
<html>
<head>
<style>
#map_canvas
{
width: 400px;
height: 400px;
}
</style>
@maxim75
maxim75 / gist:998434
Created May 30, 2011 04:03
JavaScript inheritance
<!DOCTYPE html>
<html>
<body>
<script>
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
@maxim75
maxim75 / set_loc.py
Created May 22, 2011 01:07
Setting GPS location EXIF tags using Python script and pyexiv2 library
#!/usr/bin/env python
import pyexiv2
import fractions
from PIL import Image
from PIL.ExifTags import TAGS
import sys
def to_deg(value, loc):
if value < 0:
@maxim75
maxim75 / xml.html
Created May 19, 2011 07:01
XML file upload and parsing using File API and DOM parser
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<style>
</style>
<script>
function loadFile() {
var input, file, fr;
@maxim75
maxim75 / exif.html
Created May 19, 2011 06:03
Reading EXIF info from image with JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<title>h5</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script src="exif.js"></script>
<style>
#holder { border: 1px dashed #ccc; width: 100px; height: 100px; margin: 20px auto;}
#holder.hover { border: 1px dashed #333; }
#result .property { width: 100px; }
@maxim75
maxim75 / disqus.js
Created May 19, 2011 05:52
Loading disqus on page load
<html>
<head>
<title>A</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
</head>
<body>
<button id="test">Test</button>
<div style="float: left">
@maxim75
maxim75 / deferred.js
Created May 19, 2011 05:51
Using deferred in jQuery
<html>
<head>
<style>
#map
{
width: 100px;
height: 100px;
}
</style>
@maxim75
maxim75 / gist:980251
Created May 19, 2011 05:36
Leaflet library usage example
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Quick Start Guide Example</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../dist/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="../dist/leaflet.ie.css" /><![endif]-->
</head>
<body>
@maxim75
maxim75 / freebase_suggest.js
Created May 19, 2011 04:57
Add autocomplete to text field on any website with bookmarklet
(function(){
var css_selector = 'input.tinput';
var type = '/location/australian_suburb';
if (!(window.jQuery)) {
script = document.createElement( 'script' );
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js';
document.body.appendChild(script);