Skip to content

Instantly share code, notes, and snippets.

@bencevans
bencevans / gist:4036162
Last active October 12, 2015 13:48
localisedEstimate()
# localisedEstimate:
# targetlngLat (Array|Object) = Containing the latLng you require a definition for
# Example: [9, 10]
# surroundinglngLats (Array) = Local LngLats (objects) to be used when finding the value of target.
# Example: [{lng:9.21, lat:10.23, value:34}, {lng:8.5, lat:9.78, value:10}]
# valueKey (String) = Key used for value in surroundinglngLats Objects.
# Example: 'NDWI'
localisedEstimate = (targetlngLat, surroundinglngLats, valueKey) ->
@bencevans
bencevans / tld2whois.json
Created November 3, 2012 01:08
TLD -> WHOIS Server in JSON (Originally from http://www.nirsoft.net/whois_servers_list.html)
{
"ac":"whois.nic.ac",
"ae":"whois.nic.ae",
"af":"whois.nic.af",
"ag":"whois.nic.ag",
"al":"whois.ripe.net",
"am":"whois.amnic.net",
"as":"whois.nic.as",
"at":"whois.nic.at",
"au":"whois.aunic.net",
@bencevans
bencevans / dabblet.html
Created October 6, 2012 22:17
bbar demo
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://stats.bensbit.co.uk/javascripts/bbar.js"></script>
<header>
<div class=container>
<h1>StatsBox</h1>
</div>
</header>
<div id="content" class=container>
@bencevans
bencevans / backup.php
Created September 26, 2012 21:48
PHP MySQL Backup Script
<?php
backup_tables('MYSQL_HOST','MYSQL_USER','MYSQL_PASS','MYSQL_DB');
/* backup the db OR just a table */
function backup_tables($host,$user,$pass,$name,$tables = '*')
{
$link = mysql_connect($host,$user,$pass);
@bencevans
bencevans / gist:3513313
Created August 29, 2012 14:23 — forked from mebcomputers/gist:2550712
php: create visitor log file
<?php
class log {
public $filename;
public $timestamp;
public $ip;
public $u_agent;
public $u_refer;
public $ub;
@bencevans
bencevans / license
Created July 19, 2012 00:22 — forked from zzot/license
MIT License Generator
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Ben Evans
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@bencevans
bencevans / gist:2857792
Created June 2, 2012 10:57
SQL Structure for RHoK_NDWI
-- phpMyAdmin SQL Dump
-- version 3.4.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 02, 2012 at 11:56 AM
-- Server version: 5.5.9
-- PHP Version: 5.3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";