Skip to content

Instantly share code, notes, and snippets.

Andrew W. Hill andrewxhill

Block or report user

Report or block andrewxhill

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andrewxhill
andrewxhill / batchAPI.py
Last active May 16, 2018
quick example of using the batch api over python
View batchAPI.py
import sys
import urllib
import urllib2
import json
import requests
# Start a new batch SQL task
def cartoBatchQuery(username, api_key, sql):
r = requests.post('http://%s.cartodb.com/api/v2/sql/job?api_key=%s' %(username,api_key),
headers={'content-type':'application/json'},
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewxhill on github.
  • I am andrewxhill (https://keybase.io/andrewxhill) on keybase.
  • I have a public key ASCQCpQbOhKgXK6xK9-Xo-2vx_oQgf9v6vW7q6S_ry6FFgo

To claim this, I am signing this object:

@andrewxhill
andrewxhill / AXH_Vector_Sum.sql
Created Jan 23, 2012
Sum PostgreSQL arrays in place [1,2,3] + [2,3,4] = [3,5,7]
View AXH_Vector_Sum.sql
CREATE AGGREGATE vector_sum (
sfunc = AXH_Vector_Sum,
basetype = int[],
stype = int[],
initcond = '{0}'
);
DROP FUNCTION IF EXISTS AXH_Vector_Sum(int[], int[]);
CREATE OR REPLACE FUNCTION AXH_Vector_Sum(int[], int[])
RETURNS int[] AS $$
@andrewxhill
andrewxhill / last_hour.css
Last active Jan 5, 2018
Raincloud CartoCSS
View last_hour.css
/** raincloud visualization */
@markerw: 2;
#last_1_hours{
marker-fill: #0C2C84;
marker-width: 20;
marker-line-color: #FFF;
marker-line-width: 0;
marker-line-opacity: 0;
marker-opacity: 0.3;
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Animals | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
View beforeMorningCommute.swift
let beforeCommute = SetSDK.Context(
notificationTiming: .upon,
eventAction: .exit,
eventState: .place(type: .home),
timeOfDay: .morning
)
View subscribeContext.swift
SetSDK.register(context: beforeCommute) { event as
// Send new information or an opportunity that will be valuable
let content = UNMutableNotificationContent()
content.title = "Weather Alert!"
// ...
}
@andrewxhill
andrewxhill / rivers.md
Last active Apr 28, 2017
Steps used to make map of California rivers
View getDestination.swift
class RideFinderViewController: UIViewController {
...
override func viewDidAppear(_ animated: Bool) {
// this view indicates an intent to go someplace
super.viewDidAppear(animated)
// Get the user's likely destinations using the SetSDK
// For custom control of starting location, see: http://bit.ly/getDestinationV1
You can’t perform that action at this time.