Skip to content

Instantly share code, notes, and snippets.

View aptiko's full-sized avatar

Antonis Christofides aptiko

View GitHub Profile
@aptiko
aptiko / failingtest.js
Last active May 17, 2021 16:41
Nuxt test that involves the store and does not work
import { mount } from '@vue/test-utils'
import Navbar from '@/components/Navbar.vue'
describe('Navbar', () => {
test('gets loggedOnUser from store', () => {
const wrapper = mount(Navbar)
wrapper.vm.$store.commit('setLoggedOnUser', 'alice')
expect(wrapper.vm.loggedOnUser).toBe('alice')
})
})
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.28..2.50 rows=1 width=8) (actual time=0.119..0.119 rows=1 loops=1)
-> Custom Scan (ChunkAppend) on enhydris_timeseriesrecord (cost=0.28..2.50 rows=1 width=8) (actual time=0.118..0.118 rows=1 loops=1)
Order: enhydris_timeseriesrecord."timestamp" DESC
-> Index Only Scan Backward using "1254_1254_enhydris_timeseriesrecord_pk" on _hyper_1_1254_chunk (cost=0.28..2.50 rows=1 width=8) (actual time=0.039..0.039 rows=0 loops=1)
Index Cond: (timeseries_id = 6661)
Heap Fetches: 0
-> Index Only Scan Backward using "1253_1253_enhydris_timeseriesrecord_pk" on _hyper_1_1253
@aptiko
aptiko / gist:e898be41292c7c84ac891b45125ae187
Created April 14, 2020 13:27
TimescaleDB last date EXPLAIN ANALYZE
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=81686.50..83123.40 rows=574762 width=12) (actual time=294.183..352.196 rows=564469 loops=1)
Sort Key: _hyper_1_1254_chunk."timestamp" DESC
Sort Method: external merge Disk: 14408kB
-> Append (cost=0.28..20948.68 rows=574762 width=12) (actual time=0.028..159.398 rows=564469 loops=1)
-> Index Only Scan Backward using "1254_1254_enhydris_timeseriesrecord_pk" on _hyper_1_1254_chunk (cost=0.28..2.50 rows=1 width=12) (actual time=0.010..0.010 rows=0 loops=1)
Index Cond: (timeseries_id = 6661)
Heap Fetches: 0
-> Index Scan using _hyper_1_1253_ch
@aptiko
aptiko / keybase.md
Created May 17, 2018 05:15
keybase.io declaration

Keybase proof

I hereby claim:

  • I am aptiko on github.
  • I am aptiko (https://keybase.io/aptiko) on keybase.
  • I have a public key ASBD6_RbRJXGmepWnYO3o4T_r-jx8vISvrvHrAnQ0mIZIwo

To claim this, I am signing this object:

@aptiko
aptiko / mousepos.js
Last active June 19, 2017 10:04
OpenLayers 3 Mouse Position
mouse_position = new ol.control.MousePosition({
coordinateFormat: ol.coordinate.createStringXY(4),
projection: ‘EPSG:4326’
})