Skip to content

Instantly share code, notes, and snippets.

View hathaway's full-sized avatar

Ben Hathaway hathaway

View GitHub Profile

Keybase proof

I hereby claim:

  • I am hathaway on github.
  • I am hathaway (https://keybase.io/hathaway) on keybase.
  • I have a public key whose fingerprint is 28CD F993 9D46 AE29 7556 90EA E56D 28C2 CEFB 6563

To claim this, I am signing this object:

@hathaway
hathaway / register.php
Created November 26, 2014 00:49
GoToWebinar register via API example
//Create string for GoToWebinar from same form POST data
$gtwPost = array(
"firstName" => $contact_data['FirstName'],
"lastName" => $contact_data['LastName'],
"email" => $contact_data['Email']
);
$gtwHeaders = array(
"Accept:application/vnd.citrix.g2wapi-v1.1+json",
"Content-Type:application/json",
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@hathaway
hathaway / es.sh
Last active July 12, 2017 20:32 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz
tar -xf elasticsearch-1.0.1.tar.gz
rm elasticsearch-1.0.1.tar.gz
sudo mv elasticsearch-1.0.1 /usr/local/share/elasticsearch
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
function fenceData(data) {
debugger;
console.log(data);
}
</script>
@hathaway
hathaway / elasticsearch_proxy.conf
Last active December 6, 2018 12:22
nginx proxy for elasticsearch
server {
listen 8080;
server_name elasticsearch;
client_max_body_size 50M;
error_log /var/log/nginx/elasticsearch-errors.log;
access_log /var/log/nginx/elasticsearch.log;
location / {
@hathaway
hathaway / es.sh
Created May 11, 2012 14:40 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
#sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@hathaway
hathaway / photos.js
Created February 23, 2011 02:33
Load photos from flickr with jQuery
var next_page = 1;
function load_photos(page, per_page)
{
// Load flickr images
var flickr_url = "http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&jsoncallback=?";
$.getJSON(flickr_url,
{
api_key: "GET_YOUR_OWN_API_KEY_FROM_FLICKR",
user_id: "23295851@N04",