Skip to content

Instantly share code, notes, and snippets.

View tonmcg's full-sized avatar

Tony McGovern tonmcg

View GitHub Profile
@Aymkdn
Aymkdn / spservices-startworkflow.js
Created October 11, 2012 15:22
Start a workflow with Sharepoint (JavaScript)
/**
* Start a workflow
*
* @param {Object} params
* @param {String} params.listName The name of the list
* @param {Number} params.itemID The item ID
* @param {String} params.workflowName The name of the workflow
* @param {Array|Object} [params.parameters] An array of object with {Name:"Name of the parameter", Value:"Value of the parameter"}
* @param {Function} [params.after] Callback after the request is done
*/
@d3noob
d3noob / .block
Last active April 8, 2024 12:19
Simple d3.js Graph
license: mit
@CurtHagenlocher
CurtHagenlocher / Web.ContentsCustomRetry.m
Created April 30, 2015 13:08
Demonstrates the use of a custom retry duration with Web.Contents.
let
Value.WaitFor = (producer as function, interval as function, optional count as number) as any =>
let
list = List.Generate(
() => {0, null},
(state) => state{0} <> null and (count = null or state{0} < count),
(state) => if state{1} <> null
then {null, state{1}}
else {1 + state{0}, Function.InvokeAfter(() => producer(state{0}), interval(state{0}))},
(state) => state{1})
@CurtHagenlocher
CurtHagenlocher / multipart.m
Created July 20, 2015 20:18
Using multipart/form-data with Power Query. This assumes that any files being uploaded are textual; changing this to support arbitrary binary data is possible, but wasn't interesting to me.
let
Web.MultiPartPost = (url as text, parts as record) as binary =>
let
unique = Text.NewGuid(),
boundary = "--" & unique,
crlf = "#(cr)#(lf)",
item = (name, value) =>
let
filename = Value.Metadata(value)[name]?,
contentType = Value.Metadata(value)[type]?,
@mckneisler
mckneisler / QuickBooksOnline Code.txt
Last active March 19, 2021 15:58
QuickBooks Online API Example for VBA
Public Function quote(sString As String) As String
quote = Chr(34) + sString + Chr(34)
End Function
Public Function URLEncode(sString As String) As String
Dim iLen As Integer
iLen = Len(sString)
If iLen > 0 Then
ReDim sResult(iLen) As String
@oscarperpinan
oscarperpinan / code_without_ggplot2.R
Last active December 20, 2019 10:43
beautiful-thematic-maps: alternative code without using ggplot2
## https://timogrossenbacher.ch/2016/12/beautiful-thematic-maps-with-ggplot2-only/
library(raster)
library(sp)
library(rgdal)
library(viridisLite)
library(rasterVis)
## Read age data
data <- read.csv("input/avg_age_15.csv", stringsAsFactors = F)
## Read shapefile
@MarkTiedemann
MarkTiedemann / power-query-pagination.m
Last active March 5, 2024 23:43
Power Query Pagination Example
let
BaseUrl = "https://fake-odata-api.com/v1/Entities?",
Token = "F4K3-T0K3N-D0NT-U5E-L0L",
EntitiesPerPage = 1000,
GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Bearer " & Token ]],
RawData = Web.Contents(Url, Options),
Json = Json.Document(RawData)
in Json,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / non-gis-y-webmapping.md
Last active February 8, 2019 18:01
Web mapping applications with multiple layers

Suggestions from Twitter for more "elegant" web mapping applications

Specifically I'm looking for web mapping applications that include multiple layers and don't look like an ArcGIS clone -- perhaps something that looks like it was designed by a designer rather than a GIS tech :) This is a list of responses from Twitter, many of which do look GIS-y so more suggestions are welcome...

library(tidycensus)
library(leaflet)
library(sf)
library(viridis)
options(tigris_use_cache = TRUE)
il1 <- get_acs(geography = "county",
variables = c(hhincome = "B19013_001"),
state = "IL",
geometry = TRUE) %>%