Skip to content

Instantly share code, notes, and snippets.

View owexroasia's full-sized avatar
🦄
Saving the planet

owexroasia

🦄
Saving the planet
View GitHub Profile
Assessment.__elasticsearch__.delete_index! index: Assessment.index_name
Assessment.__elasticsearch__.create_index!
Assessment.import
@owexroasia
owexroasia / oz:assessment_ranges_by_aid
Created July 15, 2020 08:52
oz:assessment_ranges_by_aid
oz:assessment_ranges_by_aid
@owexroasia
owexroasia / bundle up.sh
Created March 25, 2020 14:42
bundle up
Resolving dependencies......
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
active_model_serializers was resolved to 0.10.10, which depends on
activemodel (< 6.1, >= 4.1)
carrierwave (~> 1.0) was resolved to 1.1.0, which depends on
activemodel (>= 4.0.0)
@owexroasia
owexroasia / small range
Created March 17, 2020 09:25
small range
77145257, 77164671, 107468222, 102828588, 525323, 102702009, 21416160, 9403273, 21416160, 520965
@owexroasia
owexroasia / unit test
Created March 16, 2020 10:26
unit test
import React from 'react';
import { expect } from 'chai';
import { mount, render, shallow } from 'enzyme';
import { spy } from 'sinon';
import configureMockStore from 'redux-mock-store';
import { Provider } from 'react-redux';
import AssessmentDetails from 'components/Species/AssessmentDetails';
describe('Species/AssessmentDetails', () => {
it('without data it renders Spinner', () => {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sql ="select st_isvalid(ar.geom::geometry) from assessment_ranges ar where ar.assessment_id=871762"
rcd = ActiveRecord::Base.connection.exec_query(sql)
rcd.rows
ST_AsGeoJson
st_isvalid
https://postgis.net/docs/ST_IsValidDetail.html
https://postgis.net/docs/ST_IsValidReason.html
@owexroasia
owexroasia / notes
Created February 19, 2020 12:32
notes
https://www.flexmonster.com/question/how-to-use-a-date-or-year-month-with-elasticsearch/
@owexroasia
owexroasia / mapping.json
Created February 12, 2020 12:23
es index over size
{
"assm": {
"mappings": {
"properties": {
"assessors": {
"type": "text",
"store": true
},
"biogeolms": {
"properties": {