Skip to content

Instantly share code, notes, and snippets.

Joe Larson oeon

Block or report user

Report or block oeon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@oeon
oeon / gist:84b54ace2090904ca7ac08f2b1cbdfcc
Created Nov 8, 2019
run this to fix that: RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" asdf install ruby 2.2.4
View gist:84b54ace2090904ca7ac08f2b1cbdfcc
ruby-build: using openssl from homebrew
Downloading ruby-2.2.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2
Installing ruby-2.2.4...
WARNING: ruby-2.2.4 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
^[[A
@oeon
oeon / fulcrum-routing-data-event.js
Created Oct 27, 2019
Using Fulcrum Data Events for routing with Google Maps and MAPS.ME
View fulcrum-routing-data-event.js
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();
View index.html
<iframe width=100% height=100% src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQvHvzsKhqm4JLIJGhBcrYrZbcKQKHFzg1CBPggQ5CsCOUcvNGYcJE_qop1dOa5VoQN7Ekb84Tqbq02/pubhtml?widget=true&amp;headers=false"></iframe>
View split-csv.md

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-
View keybase.md

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 / scripts.gs
Created Feb 6, 2019
Google Apps Script for creating Google Calendar events via Fulcrum Webhooks with Location
View scripts.gs
// 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 / calc.js
Created Jan 10, 2019
Unix time calculation for Fulcrum date and time fields
View calc.js
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 Jan 10, 2019
Unix time calculation for Fulcrum date and time fields
View calc.js
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 / scripts.gs
Created Jan 10, 2019
Google Apps Script for creating Google Calendar events via Fulcrum Webhooks
View scripts.gs
// 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 / script.sh
Created Oct 12, 2018
use sed (gsed for mac/homebrew) to insert a header into .csv files & remove BOM
View script.sh
#!/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
You can’t perform that action at this time.