Skip to content

Instantly share code, notes, and snippets.

View parth-koshta's full-sized avatar
:electron:

Parth N Koshta parth-koshta

:electron:
View GitHub Profile
@parth-koshta
parth-koshta / docker-compose.yml
Created March 5, 2021 20:16
app/docker-compose.yml
version: "3.9"
services:
db:
image: mysql:8.0
command: mysqld --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_ROOT_PASSWORD=<password>
- MYSQL_DATABASE=<db>
@parth-koshta
parth-koshta / entrypoint.sh
Last active March 5, 2021 20:17
server/entrypoint.sh
#!/bin/bash
# Collect static files
echo "Collect static files"
python3 manage.py collectstatic --no-input
# Start server
echo "Starting server"
# python3 manage.py runserver 0.0.0.0:8000
gunicorn server.wsgi:application --bind 0.0.0.0:8000
@parth-koshta
parth-koshta / Dockerfile
Last active March 5, 2021 20:17
server/Dockerfile
FROM python:3.9
ENV PYTHONUNBUFFERED=1
WORKDIR /backend
RUN pip install pipenv
COPY Pipfile* /backend/
RUN pipenv lock --requirements > requirements.txt
RUN pip install -r requirements.txt
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
@parth-koshta
parth-koshta / default.conf
Last active March 5, 2021 20:18
webserver/default.conf
upstream api {
server backend:8000;
}
server {
listen 80;
location /api/ {
proxy_pass http://api;
}
@parth-koshta
parth-koshta / Dockerfile
Last active March 5, 2021 20:18
webserver/Dockerfile
FROM node:lts-alpine3.12 as build
WORKDIR /frontend
COPY ./frontend/package.json ./
COPY ./frontend/yarn.lock ./
RUN yarn install
COPY ./frontend/ ./
RUN yarn build
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
NS_ASSUME_NONNULL_BEGIN
@interface RCTSatisMeter : NSObject <RCTBridgeModule>
@end
NS_ASSUME_NONNULL_END
#import "RCTSatisMeter.h"
#import "SatisMeter/SatisMeter.h"
@implementation RCTSatisMeter
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
import React, {useEffect} from 'react';
import {View, Text, NativeModules} from 'react-native';
const App = () => {
useEffect(() => {
NativeModules.SatisMeter.hook(
<userId>, //user id
<writeKey>, // satismeter write key
{ // extra payload
name,
package com.rn_bridge_satismeter;
import android.app.Activity;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Callback;
package com.rn_bridge_satismeter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;