Skip to content

Instantly share code, notes, and snippets.

View thomasmery's full-sized avatar

Thomas Mery thomasmery

  • Aaltomeri
  • Paris
View GitHub Profile
@kjantzer
kjantzer / underscore.move.js
Created October 29, 2012 16:50
Underscore.js Mixin: Move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable()
/*
_.move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable()
*/
_.mixin({
move: function (array, fromIndex, toIndex) {
array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] );
return array;
}
@thomasmery
thomasmery / ajaxify-html5.js
Created August 18, 2012 13:35 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@steren
steren / index.html
Created November 18, 2010 02:24
call Wikipedia API using jQuery and parse result
<div id="insertTest"></div>
<script>
var wikipediaHTMLResult = function(data) {
var readData = $('<div>' + data.parse.text.* + '</div>');
// handle redirects
var redirect = readData.find('li:contains("REDIRECT") a').text();
if(redirect != '') {
callWikipediaAPI(redirect);
@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.