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
// OAuth supports 3 legged and 2 legged (aka XAuth) authentication. | |
// This app demonstrates how to use 2 legged authentication with CartoDB | |
var sys = require('sys') | |
, querystring = require('querystring') | |
, OAuth = require('oauth').OAuth | |
, EventEmitter = require('events').EventEmitter; | |
function CartoDBClient(user, password, consumer_key, consumer_secret) { |
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
<?php | |
/** | |
* This function is used to resize and crop image | |
* based on width from the center of the image | |
* | |
* creates new image from jpg,gif,png,bmp to png images | |
*/ | |
function image_resize_crop ( $src, $w, $h, $dest = null, $override = false, $createNewIfExists = false ) { | |
$ext = array_pop ( explode ('.', $src) ); | |
$filenameSrc = str_replace (".$ext", '', basename($src) ); |
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
/* | |
Copyright (c) 2012 Jabbslad | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
$(document).ready(function() { | |
// Support for AJAX loaded modal window. | |
// Focuses on first input textbox after it loads the window. | |
$('[data-toggle="modal"]').click(function(e) { | |
e.preventDefault(); | |
var url = $(this).attr('href'); | |
if (url.indexOf('#') == 0) { | |
$(url).modal('open'); | |
} else { |
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
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({ | |
options: { | |
debug: false | |
}, | |
tileSize: 256, | |
initialize: function (options) { | |
L.Util.setOptions(this, options); |
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 Unixbench results for the Hetzner EX 4S servers recently featured on HackerNews. (dd and htparm tests at the bottom) | |
- http://news.ycombinator.com/item?id=3537513 | |
- http://www.hetzner.de/en/hosting/produkte_rootserver/ex4s | |
To compare with AWS, see the Unixbench results from: http://blog.cloudharmony.com/2010/05/what-is-ecu-cpu-benchmarking-in-cloud.html | |
TLDR; the €59/mo EX 4S scores higher (1729) than AWS m2.4xlarge (1511) on single threaded loads. | |
Postscript |
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
WITH foo AS (SELECT ST_AsGeoJSON(ST_Centroid(ST_Envelope(admin1_attributes_live.the_geom))) as center, ST_AsGeoJSON(ST_Envelope(admin1_attributes_live.the_geom)) as bbox, name_1 as name, id1 FROM admin1_attributes_live WHERE admin1_attributes_live.iso = 'IDN') SELECT center, bbox, foo.name, foo.id1, sum(global_4x_grid.total_incr) as total FROM foo,global_4x_grid WHERE global_4x_grid.iso='IDN' AND global_4x_grid.id1 = foo.id1 group by foo.id1, foo.name, center, bbox ORDER BY total; | |
--HUMAN READABLE | |
WITH foo AS | |
(SELECT | |
ST_AsGeoJSON(ST_Centroid(ST_Envelope(admin1_attributes_live.the_geom))) as center, | |
ST_AsGeoJSON(ST_Envelope(admin1_attributes_live.the_geom)) as bbox, | |
name_1 as name, |
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
<div class="carousel"> | |
<a href="#" class="prev"> </a> | |
<ul id="mycarousel" class="jcarousel-skin-carousel"> | |
<?php global $ad_metabox; ?> | |
<?php query_posts('post_type=ad&showposts=-1') ?> | |
<?php if (have_posts()) : ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<li> |
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
<?php | |
/* | |
* Advanced Custom Fields - New field template | |
* | |
* Create your field's functionality below and use the function: | |
* register_field($class_name, $file_path) to include the field | |
* in the acf plugin. | |
* | |
* Documentation: |