Skip to content

Instantly share code, notes, and snippets.

View andymboyle's full-sized avatar

Andy Boyle andymboyle

View GitHub Profile
@andymboyle
andymboyle / gist:6514291
Created September 10, 2013 19:22
PostGIS spatial_ref_sys INSERT statement for 4326 SRID
The one listed on http://spatialreference.org/ref/epsg/4326/ has an errant 9 somewhere. The correct SQL statement is below:
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 4326, 'epsg', 4326, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ', 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]');
@andymboyle
andymboyle / starter-bootstrap.html
Created February 23, 2016 17:28
Starter bootstrap template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
@andymboyle
andymboyle / bootstrap.html
Created February 23, 2016 17:25
basic bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
$(document).ready(function() {
$("#cool").click(function() {
$(".whatever-div").css("background-color","blue"); //edit, body must be in quotes!
});
});
<html>
<head>
<title>Totally cool title</title>
</head>
<body>
<h1>This is a simple webpage</h1>
<p>It should have a pop-up.</p>
</body>
<script>
alert('I am doing some math. Here is 3 times 8, which equals ' + 3*7)
@andymboyle
andymboyle / problem2.html
Created February 16, 2016 03:15
JS -- Homework #2
<html>
<head>
<title>Totally cool title</title>
<style>
.radtastic {
background-color: yellow;
font-size: 14px;
}
.omgwhat {
@andymboyle
andymboyle / problem1.html
Created February 16, 2016 03:11
JS -- Homework #1
<html>
<head>
<title>Totally cool title</title>
</head>
<body>
<h1>This is a simple webpage</h1>
<p>And this is my simple paragraph.</p>
<h2>This headline is pretty cool. It should end right here.
<p>This is a paragraph. It should have normal styles.</p>
<p><a href="http://www.aol.com">This is a cool little link. It should be blue and underlined.</a></p>
@andymboyle
andymboyle / table-stuff.css
Created January 17, 2014 06:13
Make tables turn from horizontal into vertical, like a boss
@media only screen and (max-width: 550px) {
.col-label {
display: inline-block;
text-align: right;
font-weight: bold;
width: 110px;
}
/* Force table to not be like tables anymore */
UPDATE `wp_posts`
SET `post_author`=6
WHERE `post_content` LIKE '%Cole Moser%';
UPDATE `wp_posts`
SET `post_author`=5
WHERE `post_content` LIKE '%Kyle Scanlan%';
UPDATE `wp_posts`
SET `post_author`=4
@andymboyle
andymboyle / __init__.py
Created July 1, 2013 01:42
Loading the Google doc
import gdata.docs.service
import gdata.spreadsheet.service
import os
import tempfile
import csv
def get_spreadsheet(account, password, key, gid):
gd_client = gdata.docs.service.DocsService()
gd_client.email = account