This file contains hidden or 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
$.ajax({ | |
url: "http://api.worldbank.org/countries/AUT/indicators/BAR.POP.6064?per_page=10&date=2000:2011&format=jsonP&prefix=Getdata", | |
dataType: 'jsonp', | |
jsonp: false, | |
jsonpCallback: "Getdata", | |
success: function(data){ | |
/* do something awesome! */ | |
} | |
}); |
This file contains hidden or 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
sudo apt-get install g++ curl libssl-dev | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-v0.4.12.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install | |
curl http://npmjs.org/install.sh | sh |
This file contains hidden or 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
class Observer | |
actions: {} | |
init: (id) -> | |
action = id && @actions[ id ] | |
callbacks = $.Callbacks() | |
if not action | |
action = | |
notify: callbacks.fireWith, |
This file contains hidden or 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
class Scaler | |
scale: (range, domain) => | |
@rmax = domain[1] | |
@rmin = domain[0] | |
return (val) => | |
position_in = @getPositionInDomain(val) | |
position_out = @getPositionInRange(range, position_in) | |
Math.ceil(position_out) | |
This file contains hidden or 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
import os | |
import shutil | |
class FilesystemDiver(object): | |
"""crawls the filesystem and extracts | |
filepath and filenames information""" | |
def __init__(self, path): | |
self.path = path |
This file contains hidden or 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
# Setting up spinejs in Linux Mint 12 | |
# Node Version Manager (see: https://github.com/creationix/nvm) | |
sudo apt-get install curl build-essential libssl-dev #dependencies | |
git clone git://github.com/creationix/nvm.git ~/src/nvm | |
. ~/src/nvm/nvm.sh #should add this to your ~/.bashrc | |
# Node.js | |
nvm install v0.6.15 | |
nvm use v0.6.15 |
This file contains hidden or 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
class boxChart | |
# conventions: | |
# throughout the code c stands for configuration | |
# the svg left-right margins are calculated doubbling the box margin value | |
# typical svg structure: | |
# | |
# <div id="box_chart_vis"> | |
# <svg class="parent" width="140" height="500"> |
This file contains hidden or 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
<section id="nav-head" class="navbar navbar-fixed-top"></section> | |
<div class="row-fluid"> | |
<section id="links-section" class="span5"></section> | |
<section id="tags-section" class="span3"></section> | |
</div> |
This file contains hidden or 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
<script src="js/vendor/require-2.0.4.js"></script> | |
<script> | |
// Configure the AMD module loader | |
requirejs.config({ | |
// The path where your JavaScripts are located | |
baseUrl: './js/', | |
// Specify the paths of vendor libraries | |
paths: { | |
jquery: 'vendor/jquery-1.7.2', | |
tooltip: 'vendor/bootstrap-tooltip', |
This file contains hidden or 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
// Bootstrap the application | |
require(['chaplin_links_application'], function (LinksApplication) { | |
var app = new LinksApplication(); | |
app.initialize(); | |
}); |
OlderNewer