Skip to content

Instantly share code, notes, and snippets.

@oeon
oeon / scripts.gs
Created January 10, 2019 04:46
Google Apps Script for creating Google Calendar events via Fulcrum Webhooks
// Google Apps Script for creating Google Calendar events via Fulcrum Webhooks
// replace your Fulcrum API token here
var token = "";
var createEventId = "";
function doPost(e) {
return handleResponse(e);
}
@oeon
oeon / scripts.gs
Created February 6, 2019 00:01
Google Apps Script for creating Google Calendar events via Fulcrum Webhooks with Location
// Google Apps Script for creating Google Calendar events via Fulcrum Webhooks
// replace your Fulcrum API token here
var token = "";
// leave createEventId as an empty string. We'll get it in createEvent()
var createEventId = "";
function doPost(e) {
return handleResponse(e);
}
@oeon
oeon / fulcrum-routing-data-event.js
Created October 27, 2019 16:38
Using Fulcrum Data Events for routing with Google Maps and MAPS.ME
ON('change', 'routing_options', () => {
if ($routing_options == 'google') {
if (LATITUDE() && LONGITUDE()) {
OPENURL('https://maps.google.com/?q=' + LATITUDE() + ',' + LONGITUDE());
} else {
ALERT('No location provided!', 'A location is required to show Google Maps.')
}
SETVALUE('routing_options', null);
} else if ($routing_options == 'mapsme') {
let location = CURRENTLOCATION();

this has been slightly modifed for my use cases ~joe

I've had to deal with uploading big data csv files a lot. It's a pain when you encounter timeouts and upload limits, sometimes your only choice is to split the file into smaller files.

I want to show you how to do this in 3 easy steps with the Terminal!

Splitting the file:

split -l 10000 companies.csv ./split-files/chunk-
<iframe width=100% height=100% src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQvHvzsKhqm4JLIJGhBcrYrZbcKQKHFzg1CBPggQ5CsCOUcvNGYcJE_qop1dOa5VoQN7Ekb84Tqbq02/pubhtml?widget=true&amp;headers=false"></iframe>

Keybase proof

I hereby claim:

  • I am oeon on github.
  • I am oeon (https://keybase.io/oeon) on keybase.
  • I have a public key ASBW-ZRiTH19DIblcsIb3JYMvdRsa5-xRWBdXcAPL8nnTQo

To claim this, I am signing this object:

@oeon
oeon / calc.js
Created January 10, 2019 04:52
Unix time calculation for Fulcrum date and time fields
var stop = new Date($stop_date.getFullYear(), $stop_date.getMonth(), $stop_date.getDate(), $stop_time.slice(0, 2), $stop_time.slice(3, 5), 0);
SETRESULT(stop.getTime());
@oeon
oeon / calc.js
Created January 10, 2019 04:51
Unix time calculation for Fulcrum date and time fields
var start = new Date($start_date.getFullYear(), $start_date.getMonth(), $start_date.getDate(), $start_time.slice(0, 2), $start_time.slice(3, 5), 0);
SETRESULT(start.getTime());
@oeon
oeon / gdal_src_mrsid.md
Last active November 8, 2018 20:29
build GDAL from source with MrSID support

get source code http://trac.osgeo.org/gdal/wiki/DownloadSource let's use GDAL 1.10.1 for this example.

here's the page on BuildingOnUnix http://trac.osgeo.org/gdal/wiki/BuildingOnUnix

here's the page for MrSID / GDAL http://trac.osgeo.org/gdal/wiki/MrSID

get the DSDK from LizardTech https://www.lizardtech.com/developer/ - version I used was MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44 I made a folder /home/oeon/local/src and put it there. I also extracted my GDAL src code there.

i made a folder /home/oeon/local/gdal1101

@oeon
oeon / script.sh
Created October 12, 2018 21:36
use sed (gsed for mac/homebrew) to insert a header into .csv files & remove BOM
#!/bin/bash
for file in *.csv
do
# 1i means insert before line 1
gsed -i 1i"animals,numbers,colors" $file
echo "inserted header in $file!"
gsed -i "s/^\xef\xbb\xbf//" $file
echo "removed BOM in $file!"
done