This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install all the package dependecies | |
$ sudo npm install -d | |
2. Build the source using grunt | |
$ grunt build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.XMLHttpRequest){ | |
// code for IE7+, Firefox, Chrome, Opera, Safari | |
xmlhttp=new XMLHttpRequest(); | |
} | |
else { | |
// code for IE6, IE5 | |
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
xmlhttp.open("GET","maps/kmap.svg",false); | |
xmlhttp.send(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countries_data = {"type":"FeatureCollection","features":[ | |
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[74.92,37.24],[74.57,37.03],[72.56,36.82],[71.24,36.13],[71.65,35.42],[71.08,34.06],[69.91,34.04],[70.33,33.33],[69.51,33.03],[69.33,31.94],[66.72,31.21],[66.26,29.85],[62.48,29.41],[60.87,29.86],[61.85,31.02],[60.84,31.5],[60.58,33.07],[60.94,33.52],[60.51,34.14],[61.28,35.61],[62.72,35.25],[63.12,35.86],[64.5,36.28],[64.8,37.12],[66.54,37.37],[67.78,37.19],[69.32,37.12],[70.97,38.47],[71.59,37.9],[71.68,36.68],[73.31,37.46],[74.92,37.24]]]]},"properties":{"name":"Afghanistan"},"id":"AF"}, | |
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[19.44,41.02],[19.37,41.85],[19.65,42.62],[20.07,42.56],[20.59,41.88],[20.82,40.91],[20.98,40.86],[20.01,39.69],[19.29,40.42],[19.44,41.02]]]]},"properties":{"name":"Albania"},"id":"AL"}, | |
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[2.96,36.8],[8.62,36.94],[8.18,36.52],[8.25,34.64],[7.49,33.89],[9.06,3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>SVG</title> | |
</head> | |
<body> | |
<div class="container" id="viz-container"> | |
<svg width="320" height="400"> | |
<path d="M220,300 A90,80 0 0,0 140,200" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>SVG</title> | |
</head> | |
<body> | |
<div class="container" id="viz-container"> | |
<svg width="320" height="400"> | |
<path d="M139,199 A90,80 0 1,0 140,200" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Checking dependencies | |
command -v fortune >/dev/null 2>&1 || | |
{ echo >&2 "I require fortune but it's not installed. Aborting."; exit 1; } | |
command -v cowsay >/dev/null 2>&1 || | |
{ echo >&2 "I require cowsay too, but it's not installed. Aborting."; exit 1; } | |
# Set your counter limit here | |
COUNTER_LIMIT=7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Formatted string in javascript | |
*/ | |
function renderTemplate (template, obj) { | |
return template.replace(/\{\{[a-zA-Z]+\}\}/g, function (m) { | |
for (var key in obj) { | |
if (m.indexOf(key) !== -1) { | |
return obj[key]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#assume that your sources are in /src | |
cd /src | |
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz | |
#download all patches | |
for i in $(seq -f "%03g" 0 25); do | |
wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(typeof escapeHtmlEntities == 'undefined') { | |
escapeHtmlEntities = function (text) { | |
return text.replace(/[\u00A0-\u2666<>\&]/g, function(c) { | |
return '&' + | |
(escapeHtmlEntities.entityTable[c.charCodeAt(0)] || '#'+c.charCodeAt(0)) + ';'; | |
}); | |
}; | |
// all HTML4 entities as defined here: http://www.w3.org/TR/html4/sgml/entities.html | |
// added: amp, lt, gt, quot and apos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scrollTo(Y, duration, easingFunction, callback) { | |
var start = Date.now(), | |
elem = document.documentElement.scrollTop?document.documentElement:document.body, | |
from = elem.scrollTop; | |
if(from === Y) { | |
callback(); | |
return; /* Prevent scrolling to the Y point if already there */ | |
} |
OlderNewer