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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>US Map with Hawaii Inset</title> | |
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script> | |
<style> | |
#map-container { | |
position: relative; | |
width: 100%; | |
height: 600px; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import collections | |
def flatten(x): | |
if isinstance(x, collections.Iterable): | |
return [a for i in x for a in flatten(i)] | |
else: | |
return [x] |
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
How to create an animated gif using iMovie and Photoshop (yes I don't have After Effects otherwise this would be super easy)... | |
1) Open iMovie. Import movie as a new event and add it to a new Project, editing the clip as necessary | |
2) Go to Projects list, right click on appropriate project and 'Export using Quicktime', select the 'Image Sequence' file type and I would advise setting the fps to around 6-12 (you can do this by clicking 'Advanced'). Once saved you will see you have a bunch of images... | |
3) Now to Photoshop. Go to File > Scripts > Load files into Stack, to open all frame files into one document as individual layers. | |
4) Open the Animation panel, and by clicking the options icon, select 'Document Options...' Set the fps to the same as the Image Sequence. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Linking to a new map with the same center</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /> | |
<!--[if lte IE 8]> |
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
<html> | |
<head> | |
<style type="text/css"> | |
#over{ | |
position: absolute; | |
left: 20; | |
} | |
</style> | |
<script type="text/javascript"> |
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
// Stubbed out for now; this assumes that map is global and initialized. | |
// It also assumes that you're using jQuery or Zepto. | |
function zoomByAbout(e) { | |
var x = .5*$('#map').width(), | |
y = .5*$('#map').height(), | |
mouse_point = e.containerPoint, | |
new_center_point = new L.Point((x + mouse_point.x) / 2, (y + mouse_point.y) / 2), | |
new_center_location = map.containerPointToLatLng(new_center_point); | |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>MinnPost</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script> | |
<link rel="shortcut icon" href="http://www.minnpost.com//sites/default/themes/siteskin/favicon.ico" type="image/x-icon" /> | |
<meta name="keywords" content="Mark Dayton,Minnesota DFL,Minnesota GOP,Minnesota Legislature,Vikings Stadium,Voter ID Amendment" /> |
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
Running locally on MacOS X Lion | |
1. You may have postgres running locally on your machine on port 5432. We'll need to shut it down, | |
since we're going to use Postgres.app (postgresapp.com). I had previously downloaded PostgreSQL | |
from EnterpriseDB (http://enterprisedb.com/downloads/postgres-postgresql-downloads). | |
This was my process. | |
- `cd /Library/PostgreSQL/9.1/bin` | |
- Find out where postgres stores your data with `ps aux | grep postgres` (My data was in /Library/PostgreSQL/9.1/data) |
NewerOlder