Skip to content

Instantly share code, notes, and snippets.

View Happytreat's full-sized avatar
🎯
Focusing

Melodies Sim Happytreat

🎯
Focusing
View GitHub Profile
@Happytreat
Happytreat / gist:dd48116ba8698a41315494a62d3149c6
Last active August 11, 2021 16:14
Weekly development breakdown
We couldn’t find that file to show.
@Happytreat
Happytreat / Resources
Created March 6, 2020 15:18
RxSwift Notes/Resources
https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
http://reactivex.io/tutorials.html
https://github.com/ReactiveX/RxSwift/blob/master/Documentation/GettingStarted.md
@Happytreat
Happytreat / package.json
Created May 7, 2020 21:44
Setup Typescript project
{
...
"scripts": {
"start": "tsc && node ./dist/index.js",
"dev": "ts-node-dev --no-notify --respawn --transpileOnly src/index"
},
"dependencies": {},
"devDependencies": {
"@types/node": "^13.13.4",
"ts-node-dev": "^1.0.0-pre.44",
@Happytreat
Happytreat / tsconfig.json
Created May 7, 2020 21:46
TS Boilerplate: tsconfig
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"outDir": "./dist",
"sourceMap": true,
"esModuleInterop": true,
"resolveJsonModule": true
},
@Happytreat
Happytreat / tslint.json
Created May 7, 2020 21:49
TS Boilerplate: tslint
{
"defaultSeverity": "error",
"extends": "tslint-config-airbnb",
"jsRules": {},
"rules": {
"eofline": false
},
"rulesDirectory": []
}
@Happytreat
Happytreat / tsconfig.json
Created May 7, 2020 21:50
TS Boilerplate: tsconfig
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"outDir": "./dist",
"sourceMap": true,
"esModuleInterop": true,
"resolveJsonModule": true
},
@Happytreat
Happytreat / package.json
Created May 7, 2020 21:51
TS Boilerplate: package.json
{
...
"scripts": {
"start": "tsc && node ./dist/index.js",
"dev": "ts-node-dev --no-notify --respawn --transpileOnly src/index"
},
"dependencies": {},
"devDependencies": {
"@types/node": "^13.13.4",
"ts-node-dev": "^1.0.0-pre.44",
@Happytreat
Happytreat / app.yaml
Created May 7, 2020 21:55
GAE app.yaml
# see https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml for more info
runtime: nodejs
env: flex
@Happytreat
Happytreat / index.ts
Created May 7, 2020 21:57
GraphQL Boilerplate index.ts
import express from 'express'
import { ApolloServer, gql } from 'apollo-server-express'
// Some fake data (to be removed in later section)
const books = [
{
title: "Harry Potter and the Sorcerer's stone",
author: 'J.K. Rowling',
},
{
@Happytreat
Happytreat / firestore.ts
Created May 7, 2020 22:02
Firestore init
import admin from 'firebase-admin'
// Learn how to get your serviceAccountKey from https://firebase.google.com/docs/firestore/quickstart
let serviceAccountKey = require('../serviceAccountKey.json')
admin.initializeApp({
credential: admin.credential.cert(serviceAccountKey),
})
const db = admin.firestore();