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
| # To use this script, you must first change a few things. | |
| # First, you'll want to change the filepath for the sound file. | |
| # This is on line 76. Second, you might want to change the materials or the settings. | |
| # To render this, you'll need to set the background color, enable Only Render on the display window, and render it with OpenGL (it's much faster and most optimal for 2D renders.) | |
| # LICENSE = wtfpl | |
| # VERSION = 0.3 | |
| import bpy | |
| def makeMaterial(name, diffuse, alpha): |
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
| # The beginnings of a declarative model syntax for CoffeeScript. | |
| # SEE: http://almostobsolete.net/declarative-models-in-coffeescript.html | |
| # Thomas Parslow | |
| # Email: [email protected] | |
| # Twitter: @almostobsolete | |
| # The top part is the setup, see below that for the demo | |
| # To see this run right away try copy pasting it into the 'Try | |
| # CoffeeScript' box at http://jashkenas.github.com/coffee-script/ |
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
| // create a <link> with specific URL | |
| var addLink = function(url){ | |
| var link = document.createElement('link'); | |
| link.src = url; | |
| link.rel = 'stylesheet'; | |
| link.type = 'text/css'; // no need for HTML5 | |
| document.getElementsByTagName('head')[0].appendChild(link); // for IE6 | |
| }; | |
| // create a style that can append CSS rules to <head> |
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
| function getJSON(aUrl,sheetname) { | |
| //var sheetname = "test"; | |
| //var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json"; | |
| var response = UrlFetchApp.fetch(aUrl); // get feed | |
| var dataAll = JSON.parse(response.getContentText()); // | |
| var data = dataAll.value.items; | |
| for (i in data){ | |
| data[i].pubDate = new Date(data[i].pubDate); | |
| data[i].start = data[i].pubDate; | |
| } |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Attila Incze <http://atimb.me> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| // jQuery Headers support for $.ajax | |
| $.ajax({ | |
| beforeSend: function(xhrObj){ | |
| xhrObj.setRequestHeader("Content-Type","application/json"); | |
| xhrObj.setRequestHeader("Accept","application/json"); | |
| } | |
| type: "POST", | |
| url: "/article", | |
| processData: false, |
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
| Function::define = (prop, desc) -> | |
| Object.defineProperty this.prototype, prop, desc | |
| class GetterSetterTest | |
| constructor: (@_obj = {}) -> | |
| # 'obj' is defined via the prototype, the definition proxied through | |
| # to 'Object.defineProperty' via a function called 'define' providing | |
| # some nice syntactic sugar. Remember, the value of '@' is | |
| # GetterSetterTest itself when used in the body of it's class definition. |
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
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
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
| Just a quick sketch to explain how to use labels in CartoDB: | |
| http://dl.dropbox.com/u/193220/CartoDB/labels.png | |
| Something like this should work while we sort out exactly how to release this: | |
| #populated_places_points_2{ | |
| marker-fill:#0099FF; | |
| marker-line-color:white; | |
| marker-line-width:1; |
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
| /* global d3 */ | |
| var svg=d3.select("body") | |
| .append("svg") | |
| .style("width","100%"); | |
| var nodes = d3.range(400).map(function(d,i) { | |
| var radius = Math.random()*10+5 + (i<0 ? 55 : 0), | |
| x=Math.random()*300+radius, | |
| y=Math.random()*300+radius; | |
| return {radius:radius,mass:radius,x:x,y:y,px:x+Math.random()*2,py:y+Math.random()*2}; |