Skip to content

Instantly share code, notes, and snippets.

@oeon
oeon / fire_fatalities_slu.geojson
Created February 28, 2024 04:36
Fire fatality stories from an old SLU Pre-fire project (no longer online) http://slocountyfire.org/FireFatalities/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oeon
oeon / index.html
Created March 1, 2023 00:23
test html for OPENEXTENSION demo in gist
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>App Extension Example</title>
<!-- Fulcrum extension script -->
<script>(()=>{var t=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var d=t((w,o)=>{var a=new URLSearchParams(location.search),u,r=(u=c(a.get("extension")))!=null?u:{};function c(e){try{return JSON.parse(e)}catch(n){return null}}var l;o.exports=window.Fulcrum={id:r.id,url:r.url,data:(l=r.data)!=null?l:{},origin:r.origin,init:()=>{var e;Fulcrum.isReady=!0,(e=Fulcrum.onReadyOnce)==null||e.call(Fulcrum)},ready:e=>{Fulcrum.onReadyOnce=()=>{Fulcrum.isReady&&!Fulcrum.onReadyCalled&&(Fulcrum.onReadyCalled=!0,e(Fulcrum))},Fulcrum.onReadyOnce()},send:(e,{close:n=!1}={})=>{var i;e=e!=null?e:{};let s={id:Fulcrum.id,url:Fulcrum.url,data:e,close:n};(i=window.webkit)!=null&&i.messageHandlers?window.webkit.messageHandlers.extensionListener.postMessage(JSON.stringify(s)):window.parent&&window.parent.postMessage({extensionMessage:s},Fulcrum.origin)},finish:e=>{Fulcrum.send(e,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oeon
oeon / st_intersects_within.sql
Created January 12, 2020 17:28
where ESA is a polygon layer. Use PostGIS to test in/out
-- inside ESA
UPDATE htmp points SET esa = 'yes'
FROM
(SELECT DISTINCT(poi.*)
FROM vm_esa pol
JOIN htmp poi
ON (ST_Within(poi.geom, pol.geom))) inside
WHERE points.legacy_fulcrum_id = inside.legacy_fulcrum_id;
-- outside ESA
@oeon
oeon / gist.sql
Created January 7, 2020 05:59
unnested photo array - captions...aggregated back together
select _record_id, string_agg(unnest, ', ') as photos, string_agg(photos_captions, ', ') as photos_captions from (select r._record_id, r.unnest, k.labels as photos_captions from records r join rek k on k.photo = r.unnest order by _record_id) a group by _record_id order by _record_id
@oeon
oeon / gist:84b54ace2090904ca7ac08f2b1cbdfcc
Created November 8, 2019 19:04
run this to fix that: RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" asdf install ruby 2.2.4
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 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();
<iframe width=100% height=100% src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQvHvzsKhqm4JLIJGhBcrYrZbcKQKHFzg1CBPggQ5CsCOUcvNGYcJE_qop1dOa5VoQN7Ekb84Tqbq02/pubhtml?widget=true&amp;headers=false"></iframe>

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-

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: