Skip to content

Instantly share code, notes, and snippets.

View apsavin's full-sized avatar

Alexander Savin apsavin

View GitHub Profile
/**
* @param {number} sum
* @returns {string}
* @example
* 1234567 -> 1 234 567
*/
function formatNumber (number) {
return number.toString().replace(/(\d)(?=(\d{3})+([\D]|$))/g, '$1 ');
}
@chrisdickinson
chrisdickinson / smooth_sortable_animating.html
Created January 29, 2011 05:39
smoothly animate jquery sortable lists.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
ul { float:left; margin-right:20px; }
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); }
ul { width:512px; overflow:hidden; border-radius:6px; }