Skip to content

Instantly share code, notes, and snippets.

View uiteoi's full-sized avatar

Jean Vincent uiteoi

View GitHub Profile
@uiteoi
uiteoi / leftpad.js
Created March 31, 2016 21:07
leftpad( s, len, c )
module.exports = leftpad;
function leftpad( s, len, c ) {
s = s == null ? "" : String( s );
return Array( len - s.length + 1 ).join( c || c === 0 ? c : " " ) + s;
}
@uiteoi
uiteoi / yanug.html
Created December 23, 2010 10:45
Animated Yanug in JavaScript/Raphaël
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Raphael Yanug</title>
<style type="text/css">
body {
media: "screen";
@uiteoi
uiteoi / Raphael-vertical-text-alignment-test-wheel.js
Created December 29, 2009 18:42
Raphael Text Wheel - Fix vertical font alignment issues
// Show and Fix Raphael.js vertical text alignment issues
// Paste the code bellow in Raphael Playground at http://raphaeljs.com/playground.html
// Set font size, anchor and font parameters here:
size=48, anchor='end', font='Verdana'
// Set target size, set it to 0 to disable font-size animation
target_size = 12
duration = 8 // animation duration in seconds