Skip to content

Instantly share code, notes, and snippets.

@chrislkeller
chrislkeller / README.md
Last active December 18, 2020 08:12
SpreadSheet To Fusion Tables

Script to sync a Google SpreadSheet to a Fusion Table

Save for a few legacy projects that still use Fusion Tables I don't actively use this script anymore. This update hopefully solves the OAuth issue that cropped up once Google depcricated the Client Login method used by the prior version.

As always, your mileage may vary, and I welcome someone -- Google or otherwise -- to offer a long-term maintained solution.

The following is largely cribbed from a Google example here. I try to explain some of the API settings that must be enabled in the Developer's Console and elsewhere

Create your spr

@peterjaap
peterjaap / navicat_tunnel.php
Created March 13, 2013 12:28
Navicat tunnel file (the nearly unfindable ntunnel_mysql.php)
<?php //version my104
header("Content-Type: application/octet-stream");
error_reporting(0);
set_time_limit(0);
set_magic_quotes_runtime(0);
function phpversion_int()
{
list($maVer, $miVer, $edVer) = split("[/.-]", phpversion());
@iwek
iwek / grab-images-wikipedia.php
Created July 12, 2012 20:38
Retrieve Images from Wikipedia
<?php
/**
* Grab Images from Wikipedia via thier API
*
* @author http://techslides.com
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php
*/
//curl request returns json output via json_decode php function
@guss77
guss77 / Makefile
Created September 22, 2020 20:57
MariaDB update table with UUID
COMPOSE := docker-compose -p demouuid
start:
$(COMPOSE) up -d
sleep 3
while $(COMPOSE) ps | grep -q database; do \
$(COMPOSE) logs 2>/dev/null| grep -q 'MySQL init process done.' && break;\
$(COMPOSE) logs 2>/dev/null| grep -i error && break;\
$(COMPOSE) ps | grep -q Exit && break;\
done
@talos
talos / grid.sql
Created September 27, 2016 15:31
Create a grid in PostGIS for CARTO based off of arbitrary envelope and Projection
INSERT INTO <my_table_name> (cartodb_id, the_geom, the_geom_webmercator)
WITH inputs AS (SELECT
ST_Transform(ST_SetSRID(ST_MakeEnvelope(
-126.21093749999999, 23.241346102386135,
-63.28125, 50.064191736659104
), 4326), 5070) geom,
500000 width,
500000 height
), rast AS (SELECT
(st_pixelaspolygons(
@akaleeroy
akaleeroy / Connect-to-Android-WebDAV-Server.md
Last active October 14, 2021 16:31
Access phone storage over WiFi with WebDAV Server for Android

Access phone storage over WiFi

Batch file to map your Android phone as network drive in Windows.

Preview of Phone.cmd usage

Requirements

@crofty
crofty / index.html
Last active October 22, 2021 08:24
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
@ns-1m
ns-1m / gist:2296532
Created April 4, 2012 00:04
PHP Spatialite to GeoJSON
<?php
/**
* Spatialite to GeoJSON
It needs:
* apache2
* php5-cli
* php5-sqlite
library(tidyverse)
# 2017 monthly
x <- tempfile("col")
dir.create(x)
download.file("https://download.catalogueoflife.org/col/monthly/2017-02-27_dwca.zip", file.path(x, "dwca.zip"))
unzip(file.path(x, "dwca.zip"), exdir = x)
fs::dir_ls(x)
taxa <- readr::read_tsv(file.path(x, "taxa.txt"), guess_max=1e6, quote="", col_types = readr::cols(.default = "c"))
taxa %>% filter(specificEpithet == "sapiens", taxonomicStatus == "accepted name", genus=="Homo")
@tommyready
tommyready / dbcopier.py
Created October 16, 2017 17:49
Using Python to dump a Mysql database and import into another Mysql database
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def combine_files(self,file1,file2):
with open('file1', 'w') as outfile:
with open(file2) as infile: