Skip to content

Instantly share code, notes, and snippets.

View shivam-tripathi's full-sized avatar
💫
Call it magic, Call it code

Shivam Tripathi shivam-tripathi

💫
Call it magic, Call it code
  • Bangalore, India
View GitHub Profile
package main
import (
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"
"context"
"time"
"log"
"fmt"
@shivam-tripathi
shivam-tripathi / installgo.sh
Created December 24, 2020 05:24
Install Go on Linux
wget https://golang.org/dl/go1.15.6.linux-386.tar.gz
tar -C /usr/local -xzf go1.15.6.linux-386.tar.gz
sudo apt-get install gcc-multilib # required
echo "export GOROOT=/usr/local/go" >> ~/.bashrc
echo "export GOPATH=$HOME/golang" >> ~/.bashrc
echo "export GOBIN=$GOPATH/bin" >> ~/.bashrc
echo "export PATH=$PATH:$GOPATH" >> ~/.bashrc
echo "export PATH=$PATH:$GOROOT/bin" >> ~/.bashrc
travis_fold:start:worker_info
Worker information
hostname: 2bdf826a-387c-46fb-bac8-dbc8d53b07e2@1.i-0a9a0a4-production-2-worker-org-ec2.travisci.net
version: v3.10.1 https://github.com/travis-ci/worker/tree/2f4923494b1f57289a2d4b68a0861e882a7215ad
instance: 2fbacf3 travisci/ci-garnet:packer-1512502276-986baf0 (via amqp)
startup: 814.442174ms
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information
Build language: node_js
______ _ ______ _
| ___ \ | | | ___ \ (_)
| |_/ / ___ ___ | | __| |_/ / _ __ __ _ _ _ __ ____
| ___ \ / _ \ / _ \ | |/ /| ___ \| '__|/ _` || || '_ \ |_ /
| |_/ /| (_) || (_) || < | |_/ /| | | (_| || || | | | / /
\____/ \___/ \___/ |_|\_\\____/ |_| \__,_||_||_| |_|/___|
BEGIN;
DROP TABLE IF EXISTS bookbrainz.creator_import;
DROP TABLE IF EXISTS bookbrainz.edition_import;
DROP TABLE IF EXISTS bookbrainz.publication_import;
DROP TABLE IF EXISTS bookbrainz.publisher_import;
DROP TABLE IF EXISTS bookbrainz.work_import;
DROP TABLE IF EXISTS bookbrainz.discard_votes;
DROP TABLE IF EXISTS bookbrainz.link_import;
DROP TABLE IF EXISTS bookbrainz.origin_import;
@shivam-tripathi
shivam-tripathi / Data import architecture.md
Last active May 6, 2018 18:21
Data import architecture

BookBrainz: Data importing architecture

Roles

Producers

  • Reading records from the json or other form of dumps (usually from data streams)
  • Cleaning and processing records into mutually agreed data format
  • Keeping logs of records whose reading and processed has completed (Metadata recording read records for future purposes, verifying duplicates etc.)

Consumers

  • Validating data and discarding them in case they are invalid
  • Book keeping of imported records (??)
  • Inserting records into the database
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BEGIN;
DROP VIEW IF EXISTS bookbrainz.untokenized_names;
DROP MATERIALIZED VIEW IF EXISTS bookbrainz.search_mv;
DROP MATERIALIZED VIEW IF EXISTS bookbrainz.search_words_mv;
DROP VIEW IF EXISTS bookbrainz.master_entities;
DROP TRIGGER IF EXISTS alias_token_update on bookbrainz.alias;
DROP TRIGGER IF EXISTS mv_publisher_update ON bookbrainz.publisher_header;
BEGIN;
CREATE EXTENSION pg_trgm;
CREATE EXTENSION unaccent;
CREATE EXTENSION btree_gin;
-- Column to cache tokenized alias names
ALTER TABLE bookbrainz.alias
ADD COLUMN IF NOT EXISTS tokens TSVECTOR;
AchievementType model
✓ should return a JSON object with correct keys when saved (54ms)
AchievementUnlock model
✓ should return a JSON object with correct keys when saved
Alias model
✓ should return a JSON object with correct keys when saved
AliasSet model