Skip to content

Instantly share code, notes, and snippets.

View kissmygritts's full-sized avatar
🚀

Mitchell Gritts kissmygritts

🚀
  • Reno, NV
View GitHub Profile
@kissmygritts
kissmygritts / insertTelemetry.sql
Created December 21, 2016 18:26
insert telemetry.sql
INSERT INTO telemetry (raw_gps_id, animal_id, device_id, acq_time, longitude, latitude)
SELECT
raw_gps.id AS raw_gps_id,
deployments.device_id,
deployments.animal_id,
raw_gps.acq_time,
raw_gps.longitude,
raw_gps.latitude
FROM
deployments, raw_gps, devices
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kissmygritts
kissmygritts / M10.geojson
Created January 4, 2017 17:49
api output
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-- number of rows for device 19751 = 1833
SELECT count(*)
FROM gps
WHERE serial_num = '19751';
-- count of rows with join = 1833
WITH relocs AS (
SELECT
gps.id AS gps_id,
deployments.device_id,
@kissmygritts
kissmygritts / point-spatial-join.sql
Created May 17, 2017 14:43
get polygon name that a point is within
WITH points AS (
SELECT
ST_SetSRID(ST_Point(-118.9205, 39.5590), 4326) AS geom
)
SELECT
points.geom,
hunt_units_stagin.huntunit
FROM points
INNER JOIN hunt_units_stagin ON ST_Contains(hunt_units_stagin.geom, points.geom);
-- 1.4 example
-- restaurants
CREATE TABLE lu_franchises (
id char(3) PRIMARY KEY,
franchise varchar(30)
);
-- creating lookup table
INSERT INTO lu_franchises(id, franchise)
VALUES
@kissmygritts
kissmygritts / nestedCards.vue
Created June 8, 2017 22:11
nestedCards.vue
<div class="card">
<h4 class="card-header" @click="toggleVisibility('')">
""
</h4>
<div class="card-block" v-if="">
<div class="p-card" v-for="" v-bind:class="{ 'p-card-odd': oddIndex(index) }">
<div class="p-card-header">
<button type="button" class="close" @click="deleteDynElement('', index)">
<span>&times;</span>