Skip to content

Instantly share code, notes, and snippets.

@jscarto
jscarto / Map Style.css
Last active December 11, 2015 03:59
CartoDB + CartoCSS example used in Hacking Science demo January 11, 2013.
/* Visualize overall trends with point intensity
** using basic compositing options.
** Try changing 'lighten' to 'multiply' and see
** what happens.
************************************************/
#accidents2010::intensity {
first/marker-fill: #642A73;
first/marker-opacity: 0.01;
first/marker-width: 80;
first/marker-line-width: 0;
@jscarto
jscarto / tweets.txt
Created February 28, 2014 17:48
A small sample of ~ 20 tweets for an in-class Leaflet.js demo.
{"created_at":"Sat Sep 07 19:32:37 +0000 2013","id":376427807946964992,"id_str":"376427807946964992","text":"HALF TIME: @LongfordTownFC 1-0 @FinnHarpsFC http:\/\/t.co\/uDSIP5w2ob #LeagueOfIreland","source":"web","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":21898623,"id_str":"21898623","name":"Extratime.ie News","screen_name":"ExtratimeNews","location":"Dublin, Ireland","url":"http:\/\/www.extratime.ie","description":"Official Twitter Account for Extratime.ie. LOI Goodness! For latest League of Ireland news, fixtures, results, live updates & much more - http:\/\/t.co\/atZZ0pi2","protected":false,"followers_count":8709,"friends_count":807,"listed_count":72,"created_at":"Wed Feb 25 18:27:02 +0000 2009","favourites_count":38,"utc_offset":3600,"time_zone":"Dublin","geo_enabled":true,"verified":false,"statuses_count":36123,"lang":"en","contributors_enabled":false,"is_translator":f
@jscarto
jscarto / TwitterExample1.htm
Created February 28, 2014 17:55
Example HTML for Simple Leaflet Map (including JQuery)
<!DOCTYPE html>
<html>
<head>
<title>My First Leaflet Map</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
@jscarto
jscarto / TwitterExample2.htm
Created February 28, 2014 17:56
Second example of a simple Leaflet map that displays collected Tweets.
<!DOCTYPE html>
<html>
<head>
<title>My First Leaflet Map</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
@jscarto
jscarto / TwitterExample3.htm
Created February 28, 2014 17:57
Third Leaflet example that scales drawn tweets by character count.
<!DOCTYPE html>
<html>
<head>
<title>My First Leaflet Map</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
@jscarto
jscarto / TwitterExample4.htm
Created February 28, 2014 17:59
Fourth Leaflet example. Adding basic interaction to drawn tweets.
<!DOCTYPE html>
<html>
<head>
<title>My First Leaflet Map</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
@jscarto
jscarto / TwitterExample5.html
Last active August 29, 2015 13:56
Fifth Leaflet example. This time, we'll add a pop-up to the tweets to reveal the tweet's text.
<!DOCTYPE html>
<html>
<head>
<title>My First Leaflet Map</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
+++++++2313
fr cf]6
m
/////////////////////////42jk[ v'yb8--50+
hhg ,hhg nh h... . nhnhn nn`
hnñ
Y h///5h814+1898h8j8
†¥lnllLLLlllllllllllgim
h
@jscarto
jscarto / temp_data
Created June 26, 2015 18:00
dput of depth data
structure(list(depth = c(0, 10, 20, 30, 50, 75, 100, 0, 10, 20,
30, 50, 75, 100, 0, 10, 20, 30, 50, 75, 100, 0, 10, 20, 30, 50,
75, 100, 0, 10, 20, 30, 50, 75, 100, 0, 10, 20, 30, 50, 75, 100,
0, 10, 20, 30, 50, 75, 100, 0, 10, 20, 30, 50, 75, 100, 0, 10,
20, 30, 50, 75, 100, 0, 10, 20, 30, 50, 75, 100), time = c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L,
10L, 10L, 10L, 10L, 10L, 10L), temp = c(0.121490292040404, -0.00597569922857918,
@jscarto
jscarto / pansharpen.js
Last active July 19, 2022 02:45
Pan-sharpen and display a Landsat 8 scene in Google Earth Engine
// Band combinations
var natural = ['B4', 'B3', 'B2'];
var swir = ['B6', 'B5', 'B3'];
var urban = ['B7', 'B6', 'B4'];
var veg = ['B5', 'B4', 'B3'];
// Get a Landsat scene
var scene = ee.Image('LANDSAT/LC8_L1T_TOA/LC80450332015263LGN00');
// Convert the RGB bands to the HSV