Skip to content

Instantly share code, notes, and snippets.

View schadokar's full-sized avatar
😵

Shubham Chadokar schadokar

😵
View GitHub Profile
@schadokar
schadokar / message.js
Last active April 13, 2019 19:16
client's message.js
import React, { Component } from "react";
import axios from "axios";
let endpoint = "http://localhost:4000";
class Message extends Component {
constructor(props) {
super(props);
this.state= {
@schadokar
schadokar / App.js
Created April 13, 2019 19:24
docker-ethereum App.js
import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from "react-router-dom";
import './App.css';
import message from "./message";
class App extends Component {
render() {
return (
<Router>
@schadokar
schadokar / Dockerfile
Created April 13, 2019 19:30
docker-ethereum Dockerfile client
# using node alpine as base image
FROM node:alpine
# working dir ./app
WORKDIR /app
# Copy react package.json
COPY ./package.json .
# install dependencies
@schadokar
schadokar / Dockerfile
Created April 14, 2019 04:44
docker-ethereum server dockerfile
# using node alpine as base image
FROM node:alpine
# working dir ./app
WORKDIR /app
# Install the prerequisites to install the web3 and other ethereum npm packages
RUN apk update && apk upgrade && apk add --no-cache bash git openssh
RUN apk add --update python krb5 krb5-libs gcc make g++ krb5-dev
@schadokar
schadokar / docker-compose.yml
Created April 14, 2019 09:00
docker-ethereum docker-compose.yml
version: "3"
services:
ganache:
build:
context: .
dockerfile: Dockerfile.ganache
ports:
- "8545:8545"
dapp:
build: .
@schadokar
schadokar / App.css
Created April 20, 2019 14:28
docker-ethereum
/*
Styles from this codepen:
https://codepen.io/official_naveen/pen/rgknI
*/
body {
@schadokar
schadokar / middleware.go
Created July 23, 2019 15:46
go-todo middleware
package middleware
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"../models"
@schadokar
schadokar / router.go
Created July 23, 2019 17:27
go-todo router
package router
import (
"../middleware"
"github.com/gorilla/mux"
)
// Router is exported and used in main.go
func Router() *mux.Router {
@schadokar
schadokar / to-do-list.js
Created July 25, 2019 15:59
go-to-do to-do-list component
import React, { Component } from "react";
import axios from "axios";
import { Card, Header, Form, Input, Icon } from "semantic-ui-react";
let endpoint = "http://localhost:8080";
class ToDoList extends Component {
constructor(props) {
super(props);
@schadokar
schadokar / time-in.js
Last active August 5, 2019 11:21
time-in
const peeTimeCalculator = (
currentEffHr,
currentEffMins,
lastInHr,
lastInMins,
avgHrs = 7,
avgMins = 0
) => {
let totalMins = currentEffHr * 60 + currentEffMins;
let lastLogin = lastInHr * 60 + lastInMins;