Skip to content

Instantly share code, notes, and snippets.

View netconstructor's full-sized avatar
💭
pushing pixels

Christian Hochfilzer netconstructor

💭
pushing pixels
View GitHub Profile
@javisantana
javisantana / redbullstratos_cartodb.py
Created October 15, 2012 08:13
script used to feed cartodb with the redbull stratos mission info
import time
import urllib2
import json
from cartodb import CartoDBAPIKey, CartoDBException
from secret import API_KEY
URL = 'http://services.redbullstratos.com/LiveData/Get'
cl = CartoDBAPIKey(API_KEY, 'javi')
@jatorre
jatorre / gist:3891312
Created October 15, 2012 08:04
Calculating Stratos distances
//Furthest distance travelled from start point. // http://javi.cartodb.com/api/v2/sql?q=
WITH points AS
(SELECT
(SELECT (the_geom) FROM stratos ORDER BY id ASC LIMIT 1) as p1,
(SELECT (the_geom) FROM stratos
WHERE ST_x(the_geom)<180 AND ST_x(the_geom)>-180 AND ST_x(the_geom)<>0
AND ST_x(the_geom)<>0 ORDER BY ST_Distance(the_geom,(SELECT the_geom
FROM stratos ORDER BY id ASC LIMIT 1)) DESC LIMIT 1) as p2
)
SELECT ST_distance(p1::geography,p2::geography) as furthest_distance FROM points
@cbare
cbare / predictive_modeling_ccle.Rmd
Created October 11, 2012 12:08
Predictive modeling demo Knitr-ized
Predictive Modeling: Drug Response in Cancer Cell Lines
=======================================================
This is a demo of **Knitr**, an R package for authoring executable documents, documents that mix formatted text, source code and graphical output. I've used In Sock's demos of drug response in [CCLE][1] data, but I've probably gotten most of the analysis mixed up. Apologies to In Sock.
Analysis of cancer cell lines for drug sensitity using:
* [Cancer Cell Line Encyclopedia][1]
* [Gene Set Enrichment Analysis][2]
Workflow
@javisantana
javisantana / cartodb_load.js
Created October 10, 2012 17:07
new cartob.js interface
function main() {
var map = L.map('map').setView([0, 0], 3);
L.tileLayer('http://a.tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: 'stamen'
}).addTo(map);
cartodb.loadLayer(map, {
user: 'development',
@andrewxhill
andrewxhill / backbone-example.js
Created September 12, 2012 19:28
CartoDB Backbone for data-driven webpages
// Set the CartoDB user account
var CartoDB = Backbone.CartoDB({
user: viz2
});
// Create a model, here directly from SQL
// You can also do it with simply a table name and list of columns
var parksModel = CartoDB.CartoDBCollection.extend({
sql: "SELECT name FROM nyc_parks ORDER BY ST_Area(the_geom) DESC LIMIT 10"
});
@neo22s
neo22s / seoreport.php
Created August 19, 2012 08:59
seo report php
<?php
/**
*
* SEO report for different metrics
*
* @category SEO
* @author Chema <[email protected]>
* @copyright (c) 2009-2012 Open Classifieds Team
* @license GPL v3
* Based on seo report script http://www.phpeasycode.com && PHP class SEOstats
@Yegoroff
Yegoroff / gist:3093936
Created July 11, 2012 22:02
PlainElastic.Net facet query builder sample
using System;
using PlainElastic.Net;
using PlainElastic.Net.Queries;
using PlainElastic.Net.Serialization;
using PlainElastic.Net.Utils;
namespace FacetQuerySample
{
class Item
@mourner
mourner / geojson.js
Created July 6, 2012 21:40
Leaflet GeoJSON API proposal
var geojson = L.geoJson(data, {
// style for all vector layers (color, opacity, etc.), either function or object (optional)
style: function (feature) {
return feature.properties && feature.properties.style;
},
// function for creating layers for GeoJSON point features (optional)
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
@jedschneider
jedschneider / gh-pages-tips.md
Created June 7, 2012 17:59
github pages tips for jekyll wiki

Working With Github Pages

The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.

Gitignore

Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.

Working With Code Partials

@tobiash
tobiash / qredis.coffee
Created June 6, 2012 20:30
Q + node_redis
# Applies Q.nbind to all redis operations and returns a wrapped client
_ = require("underscore")._
Q = require "q"
nbindOps = (client) ->
functions = _.functions client
# All the ops are available as upper/lowercase functions, I exploit this
# to filter out the Redis operations from the other functions of the client
#