Skip to content

Instantly share code, notes, and snippets.

View danielsmykowski1's full-sized avatar

Daniel Smykowski danielsmykowski1

  • Roscoe, Illinois, United States
View GitHub Profile
@danielsmykowski1
danielsmykowski1 / main.go
Created December 5, 2019 21:17
main.go Golang file
package main
import (
"log"
"mauappa-go/config"
"mauappa-go/controller"
"mauappa-go/repository/firestore"
"mauappa-go/service"
"net/http"
"os"
@danielsmykowski1
danielsmykowski1 / chat_client.go
Created December 5, 2019 21:14
A Golang file that uses websocket in golang throught gorilla/websocket.
package main
import (
"bytes"
"log"
"net/http"
"time"
"github.com/gorilla/websocket"
)
@danielsmykowski1
danielsmykowski1 / product-detail.page.html
Created December 5, 2019 11:56
An Ionic Angular Component
<ion-header>
<ion-toolbar>
<ion-title>Details</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header>
<ion-card-title>{{product.prod_name}}</ion-card-title>
@danielsmykowski1
danielsmykowski1 / CustomerListByGender.js
Last active December 1, 2019 14:13
A code sample for React Hooks
import React, { useEffect, useState } from "react";
function CustomersWithGender({ gender }) {
const [customers, setCustomers] = useState([]);
useEffect(
async () => {
const res = await fetch(`https://upoint.store.back.au/api/customers?gender=${gender}`);
const json = await res.json();
setCustomers(json.results);
@danielsmykowski1
danielsmykowski1 / Page.js
Last active December 1, 2019 13:12
Code samples showing how to use React context
import {ThemeContext, themes} from './theme-context';
import ThemedButton from './themed-button';
import ThemeTogglerButton from './theme-toggler-button';
// An intermediate component that uses the ThemedButton
function Toolbar(props) {
return (
<ThemedButton onClick={props.changeTheme}>
Change Theme
</ThemedButton>
@danielsmykowski1
danielsmykowski1 / Categories.js
Created November 27, 2019 11:55
A React category list component that uses react-beautiful-dnd for changing orders of list items.
import React, { Component } from 'react';
// import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
import classnames from 'classnames';
import {
Page, Card
} from '@shopify/polaris';
@danielsmykowski1
danielsmykowski1 / CommodityEdit.dart
Created November 26, 2019 05:23
A Flutter component using Bloc pattern
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:image_picker/image_picker.dart';
import 'package:lumbungrempah_common/bloc/commodity/commodity.dart';
import 'package:lumbungrempah_common/model/commodity.dart';
import 'package:lumbungrempah_flutter/api/commodity_service_api_impl.dart';
import 'package:lumbungrempah_flutter/api/storage_service_api_impl.dart';
@danielsmykowski1
danielsmykowski1 / main.screen.tsx
Created November 25, 2019 20:28
A React main screen component written in Typescript
import * as React from 'react';
import { reaction } from 'mobx';
import { observer, inject } from 'mobx-react';
import * as usb from 'usb-detection'
import * as moment from 'moment'
import {
Table, Pagination, Header, Icon, Form,
Container, Modal, Button, Input,
} from 'semantic-ui-react';
@danielsmykowski1
danielsmykowski1 / notifications.tsx
Last active November 25, 2019 20:26
A React Typescript Notifications component
import * as React from 'react'
import * as NotificationSystem from 'react-notification-system'
import { Message } from 'semantic-ui-react'
import { AsyncError } from '../../models/async.models'
import { I18N } from '../../i18n';
export interface NotificationConfig {
position?: 'tr' | 'tl' | 'tc' | 'br' | 'bl' | 'bc'
delay?: number
@danielsmykowski1
danielsmykowski1 / vue-tel-input-customized.vue
Created November 24, 2019 13:14
A vue-tel-input component that is customized to get the look-and-feel of Vuetify components.
<template>
<div :class="topContainerClasses">
<div
v-click-outside="clickedOutside"
:tabindex="dropdownOptions && dropdownOptions.tabindex ? dropdownOptions.tabindex : 0"
:class="['vti__dropdown', { open: open }]"
@keydown="keyboardNav"
@click="toggleDropdown"
@keydown.esc="reset"
>