Skip to content

Instantly share code, notes, and snippets.

View wovalle's full-sized avatar

Willy Ovalle wovalle

View GitHub Profile
@wovalle
wovalle / gist:fa06b9beb3e692ead956
Last active August 2, 2017 03:57
RPI - docker
#Download and install raspbian-lite
#Expand filesystem
sudo raspi-config
expand filesystem
sudo reboot
#Test new space
df -H
const five = require("johnny-five")
const client = require('messenger').createSpeaker(8000)
const stopwatch = require('../stopwatch')
let board, buttons, timer
board = new five.Board({
repl: false
})
const buttonsObj = {
@wovalle
wovalle / cloudSettings
Last active August 25, 2020 14:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-25T14:55:45.150Z","extensionVersion":"v3.4.3"}
@wovalle
wovalle / cloudSettings
Last active September 22, 2018 20:34
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-22T20:34:19.139Z","extensionVersion":"v3.1.2"}
@wovalle
wovalle / fireorm-model.ts
Last active February 6, 2019 15:58
Introducing fireorm!
class Band {
id: string;
name: string;
formationYear: number;
genres: Array<string>;
}
import { Collection } from 'fireorm';
@Collection()
class Band {
id: string;
name: string;
formationYear: number;
genres: Array<string>;
}
import * as admin from 'firebase-admin';
const serviceAccount = require('../firestore.creds.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`,
});
const firestore = admin.firestore();
import Band from './models/Band'
import { getRepository } from 'fireorm'
const bandRepository = getRepository(Band, firestore);
// Create a band
const band = new Band();
band.name = "A Perfect Circle";
band.formationYear = 1999;
band.genres = ['alternative-rock', 'hard-rock']
import { Collection, SubCollection, ISubCollection } from 'fireorm';
class Album {
id: string;
name: string;
year: number;
}
@Collection()
export class Band {
import { getRepository } from 'fireorm';
import Band from './models/Band';
const bandRepository = getRepository(Band);
const band = await bandRepository.findById('red-hot-chili-peppers');
const albumsAfter2000 = await band.albums.whereGreaterOrEqualThan('year', 2000).find();