Skip to content

Instantly share code, notes, and snippets.

View faiyaz26's full-sized avatar
🤞
Focusing on multiple projects!!!

Ahmad Faiyaz faiyaz26

🤞
Focusing on multiple projects!!!
View GitHub Profile
@faiyaz26
faiyaz26 / mobx_store.ts
Created October 13, 2019 14:32
MobX depedency tree
import {action, computed, observable, runInAction} from 'mobx';
import Loadable from './loadable';
export default class Loadable<T> {
// our state entity class
public static create<T>(val?: T) {
return new Loadable<T>(val);
}
@faiyaz26
faiyaz26 / Readme.md
Created March 12, 2019 03:35
basic http function on google cloud function
// Setup basic express server
var os = require('os')
var bodyParser = require('body-parser');
var express = require('express');
var path = require('path');
var config = require('./config');
var app = express();
app.use(bodyParser.json()); // for parsing application/json
apiVersion: v1
kind: Service
metadata:
name: rtn-k8s-service
labels:
app: rtn-k8s
spec:
ports:
- port: 80
targetPort: 3000
apiVersion: apps/v1
kind: Deployment
metadata:
name: rtn-k8s-deployment
labels:
app: rtn-k8s
spec:
replicas: 3
selector:
matchLabels:
apiVersion: v1
kind: Service
metadata:
name: rtn-k8s-service
labels:
app: rtn-k8s
spec:
ports:
- port: 80
targetPort: 3000
apiVersion: apps/v1
kind: Deployment
metadata:
name: rtn-k8s-deployment
labels:
app: rtn-k8s
spec:
replicas: 1
selector:
matchLabels:
FROM node:8
WORKDIR /usr/src/app
COPY /public /usr/src/app/public
COPY package.json .
COPY config.js .
COPY server.js .
RUN npm install
@faiyaz26
faiyaz26 / main.js
Last active August 27, 2018 14:06
client implementation
var app = new Vue({
el: "#app",
data: {
connection_status: null,
user_id: null,
server_hostname : null,
notification_count : 0,
},
methods: {
@faiyaz26
faiyaz26 / server.js
Last active August 27, 2018 14:05
RTN-K8S
// Setup basic express server
var os = require('os')
var bodyParser = require('body-parser');
var express = require('express');
var path = require('path');
var config = require('./config');
var app = express();
app.use(bodyParser.json()); // for parsing application/json