Skip to content

Instantly share code, notes, and snippets.

@ntorrey
ntorrey / SurrealDB_driver_with_export_and_import
Last active October 2, 2023 21:43
A SurrealDB driver with export and import capability
A (very hacky!) surreal db driver with export/import capability!
I had a lot of fun making this! It's for an angular project I'm working on as a hobby.
I am by no means a professional, so feedback and suggestions are welcome.
Let me know if you have any questions!
After injecting the service:
constructor(private surreal: SurrealService)
You can construct queries like this, returned as an observable: (This is just a simple example)
this.surreal
@ntorrey
ntorrey / gist.page.ts
Created September 23, 2022 13:51
Simple angular component (using Ionic UI components) to test surrealDB.
import {Component} from '@angular/core'
import {take} from 'rxjs/operators'
import {HttpClient, HttpHeaders} from '@angular/common/http'
import {Buffer} from 'Buffer'
@Component({
selector: 'surreal',
template: `
<ion-header>
<ion-toolbar>
@ntorrey
ntorrey / #Tab Swiper Component
Last active April 30, 2022 18:50
Tab Swiper Component (Ionic/Angular)
// Full-sized Tab (Segment) Swiper Component for use in Ionic/Angular Apps.
// The only dependency that you need besides Ionic and Angular is Swiper.js.
// It's not a super-fancy component. It's simply an <ion-segment> component linked to a <swiper> component.
// When you swipe to a different page, the segment on top will update and vice-versa.
// The component makes use of <ion-content> internally, so don't place this component inside an <ion-content> element
// Don't forget to import the tab-swiper.module.ts
// Implementation in your component
<app-tab-swiper selectedTab="Slide 1">