Skip to content

Instantly share code, notes, and snippets.

View lgersman's full-sized avatar
💭
Stecke voller Bratentang 💪

lars.gersmann lgersman

💭
Stecke voller Bratentang 💪
View GitHub Profile
@lgersman
lgersman / README.md
Last active August 3, 2019 13:43
d3.js selection frame example.
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame

(The circles are just for illustrating purposes)

See it live : http://bl.ocks.org/lgersman/5310854

@lgersman
lgersman / jquery_ajax_file_upload.js
Created September 20, 2012 09:43
basic jquery.upload.js usage example
/*
* track file upload progress using the Deferred returned from the $.ajax call.
*
* See https://github.com/lgersman/jquery.orangevolt-ampere/blob/master/public/lib/ampere/jquery.upload.js
*/
$.upload( form.action, new FormData( myForm))
.progress( function( progressEvent, upload) {
if( progressEvent.lengthComputable) {
var percent = Math.round( progressEvent.loaded * 100 / progressEvent.total) + '%';
if( upload) {
@lgersman
lgersman / jquery_ajax_file_upload_3.js
Created September 17, 2012 14:35
query.upload.js usage example using local progress event handler
/*
* track file upload progress using local progress event handler.
*
* See https://github.com/lgersman/jquery.orangevolt-ampere/blob/master/public/lib/ampere/jquery.upload.js
*/
$.ajax({
processData : false,
contentType : false,
data : new FormData( myForm),
type : 'POST',
@lgersman
lgersman / jquery_ajax_file_upload_2.js
Created September 17, 2012 14:31
jquery.upload.js usage example using global progress event handler
/*
* track file upload progress using global progress event handler.
*
* See https://github.com/lgersman/jquery.orangevolt-ampere/blob/master/public/lib/ampere/jquery.upload.js
*/
$( document).on( 'ajaxProgress', function( jqEvent, progressEvent, upload, jqXHR) {
if( progressEvent.lengthComputable) {
var percent = Math.round( progressEvent.loaded * 100 / progressEvent.total) + '%';
if( upload) {
@lgersman
lgersman / gist:2575160
Created May 2, 2012 08:42
ant task reading version/author/package from debian/changelog
<?xml version="1.0" encoding="UTF-8"?>
<project name="read-debian-changelog-scripted" default="build">
<scriptdef name="debian-changelog" language="javascript">
<attribute name="prefix"/>
<![CDATA[
importPackage(
java.lang,
java.util,
java.io,