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
#!/bin/sh -x | |
# These variables are always passed to build.sh | |
DIST_DIR="$1" | |
TMP_DIR="$2" | |
ROOT_DIR="$3" | |
PROJNAME="fuse_wait" | |
DESTDIR="usr/local/bin" |
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
SELECT count(cartodb_id) as ct, ST_Transform(ST_Buffer(ST_SnapToGrid(the_geom,0.002),0.001, ‘quad_segs=2 endcap=square’),3857) as the_geom_webmercator FROM hoteles_playground GROUP BY ST_SnapToGrid(the_geom,0.002) | |
#hoteles_playground{ | |
polygon-fill:#FF6600; | |
polygon-opacity:.7; | |
} | |
#hoteles_playground[ct<=40]{ | |
polygon-fill:#BD0026} | |
#hoteles_playground[ct<=20]{ | |
polygon-fill:#F03B20} |
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
CREATE TYPE CDB_DensityGridPair AS ( | |
geom GEOMETRY, | |
val FLOAT | |
); | |
CREATE OR REPLACE FUNCTION CDB_DensityGrid(table_name TEXT, geom_name TEXT, dimension FLOAT) | |
RETURNS SETOF CDB_DensityGridPair AS $$ | |
DECLARE | |
BEGIN | |
RETURN QUERY | |
EXECUTE 'SELECT ST_Envelope(GEOMETRYFROMTEXT(''LINESTRING(''||(st_xmax(geom)+(seed/2))||'' ''||(st_ymax(geom)+(seed/2))||'', ''||(st_xmin(geom)-(seed/2))||'' ''||(st_ymin(geom)-(seed/2))||'')'',3857)) as geom, val FROM (SELECT '||dimension||' as seed, count(*)::float as val, |
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
#countries { | |
::shadow1, ::shadow2, ::shadow3 { | |
line-color: #024; | |
line-join: round; | |
} | |
::shadow1 { | |
line-opacity: 0.03; | |
line-width: 7; | |
} | |
::shadow2 { |
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
//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 |
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
################################### | |
## CartoDB 2.0 Install [Working] ## | |
## Tested on Ubuntu 12.04 ## | |
################################### | |
# Change password | |
passwd | |
adduser [username] | |
adduser [username] sudo |
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
CREATE TYPE pluto_reverse_geocode_result AS (address text, ownername text,distance float); | |
CREATE OR REPLACE FUNCTION pluto_reverse_geocode(float,float,int) RETURNS SETOF pluto_reverse_geocode_result | |
AS ' | |
WITH subq as (SELECT address,the_geom,ownername | |
FROM nyc_mappluto_13v1 | |
ORDER BY the_geom <-> CDB_LatLng($1,$2) LIMIT 20) | |
SELECT address,ownername, | |
ST_Distance(the_geom::geography, CDB_LatLng($1,$2)::geography) as distance | |
FROM subq | |
WHERE ST_Distance(the_geom::geography, CDB_LatLng($1,$2)::geography) < $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
#!/usr/bin/env ruby | |
require 'JSON' | |
device_types = JSON.parse `xcrun simctl list -j devicetypes` | |
runtimes = JSON.parse `xcrun simctl list -j runtimes` | |
devices = JSON.parse `xcrun simctl list -j devices` | |
devices['devices'].each do |runtime, runtime_devices| | |
runtime_devices.each do |device| |
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
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
OlderNewer