Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / jquery.validate.test.html
Created June 8, 2011 07:21
Using jquery.validate.js
<!DOCTYPE html>
<html>
<head>
<style>
.field
{
border: 1px solid #999;
}
label.error
@maxim75
maxim75 / gist:1026623
Created June 15, 2011 07:08
Create a Dynamic Scrolling Content Box Using AJAX
<!-- http://webdeveloperplus.com/jquery/create-a-dynamic-scrolling-content-box-using-ajax/#respond -->
<!DOCTYPE html>
<html>
<head>
<style>
#container{
width:400px;
@maxim75
maxim75 / gist:1037392
Created June 21, 2011 07:23
Accessing wikipedia api with JavaScript
<!DOCTYPE html>
<html>
<head>
<style>
</style>
<!-- JQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">
</script>
@maxim75
maxim75 / gist:1044102
Created June 24, 2011 02:25
WP Links mapping
@s
.net .NET software development
chrome Google Chrome plugins
development Software development
ebook Ebook tools
editors Text editors
firefox Firefox plugins
graphics Graphic editiing and processing
Security Security
webtools Web based tools
@maxim75
maxim75 / gist:1050481
Created June 28, 2011 04:19
Plupload - handling POST request in ASP.NET
var chunk = Request.Form["chunk"] != null ? int.Parse(Request.Form["chunk"]) : 0;
var fileName = Request.Form["name"] ?? "";
//open a file, if our chunk is 1 or more, we should be appending to an existing file, otherwise create a new file
var fs = new FileStream(Server.MapPath("/files/" + fileName), chunk == 0 ? FileMode.OpenOrCreate : FileMode.Append);
//write our input stream to a buffer
var buffer = new Byte[Request.Files[0].InputStream.Length];
Request.Files[0].InputStream.Read(buffer, 0, buffer.Length);
@maxim75
maxim75 / gist:1064422
Created July 5, 2011 07:43
Bulk downloader for QR codes using Google Charts API
using System.Diagnostics;
using System.IO;
using System.Web;
namespace Qr
{
class Program
{
static void Main(string[] args)
{