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 / MainActivity.kt
Last active November 1, 2019 21:23
Kotlin MainActivity to start walkbase SDK (android project in a flutter project)
package com.dansmy.walkbase_start
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import android.support.annotation.RequiresApi
import android.support.design.widget.Snackbar
@danielsmykowski1
danielsmykowski1 / CustomDropdownList.js
Created November 2, 2019 04:19
React custom dropdown list.
import React, { PureComponent } from 'react';
import { is, List } from 'immutable';
import onClickOutside from 'react-onclickoutside';
import TetherComponent from 'react-tether';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import SelectionDropdown from '../SelectionDropdown';
/*
* The selected option needs to be displayed first,
@danielsmykowski1
danielsmykowski1 / EntryDetailInfoComponent.js
Last active November 25, 2019 16:02
A angular component to show detail information of an entry and to edit its content.
import { Component, OnDestroy, OnInit } from '@angular/core';
import { EntryService } from '../entry.service';
import { EntrySelectorService } from '../../entry-selector/entry-selector.service';
import { Entry } from '../../../../core/models/entry.model';
import { Subscription } from 'rxjs/Subscription';
import { FormBuilder, FormGroup } from '@angular/forms';
import { FuseUtils } from '../../../../core/fuseUtils';
import { fuseAnimations } from '../../../../core/animations';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
@danielsmykowski1
danielsmykowski1 / constructionNotes.controller.js
Last active November 2, 2019 11:47
This is the nodejs controller that creates, reads, updates and deletes construction notes. It also shows how to save, update and delete file contents using cloudinary server and how to convert html to pdf in nodejs by using html-pdf package.
const request = require("request");
const fs = require('fs');
const stream = require('stream');
const pdf = require('html-pdf');
const ConstructionNote = require('../models/constructionNote.model');
const cloudinary = require('cloudinary').v2;
cloudinary.config({
cloud_name: "your cloud name",
api_key: "your api key",
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\ManualPollPage;
use App\ManualFuture;
use App\ManualFutureAnswer;
use App\ManualCandidate;
use App\Facades\Calculation;
@danielsmykowski1
danielsmykowski1 / AddItem.js
Created November 2, 2019 12:03
A react component that uses Formik and Yup for form validation and @shopify/polaris components.
import React, { Component } from 'react';
import { Formik } from 'formik';
import * as Yup from 'yup';
import {
Card,
Form,
FormLayout,
InlineError,
TextStyle,
TextField,
@danielsmykowski1
danielsmykowski1 / ChartPieAndDonut.vue
Created November 2, 2019 12:14
Vue.js component for showing pie and donut charts
<template>
<div v-if="startDate" class="piechart">
<div class="chart-filter in-toolbar">
<custom-date-range-picker
rangeType="all"
:initialRange="dateRange"
:pickHandler="pickHandler"
:style="{display: showPicker ? 'inline-flex' : 'none'}"
:startDate="startDate"
/>
@danielsmykowski1
danielsmykowski1 / CustomDateRangePicker.vue
Created November 2, 2019 12:19
Vue.js custom date range picker component
<template>
<el-date-picker
v-model="dateRange"
:type="pickerType"
align="right"
unlink-panels
:range-separator="$t('general.date_range.range_separator')"
:start-placeholder="$t('general.date_range.start_date')"
:end-placeholder="$t('general.date_range.end_date')"
:format="viewFormat"
@danielsmykowski1
danielsmykowski1 / message_service_api_impl.dart
Created November 2, 2019 12:25
AngularDart service implementation file for creating, reading, updating and deleting messages via firebase firestore
import 'package:cashjar_common/model/message.dart';
import 'package:cashjar_common/api/message_service_api.dart';
import 'package:firebase/firebase.dart' as firebase;
import 'package:firebase/firestore.dart';
import 'package:firebase/firestore.dart' as fs;
class MessageServiceApiImple extends MessageServiceApi {
@override
Stream<List<Message>> getMessageList(String offerId) {
fs.Firestore firestore = firebase.firestore();
@danielsmykowski1
danielsmykowski1 / message_input_component.css
Created November 2, 2019 12:32
AngularDart message input component for chatting PWA
:host {
background-color: #eae0da;
width: 100%;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-direction: row;
-webkit-flex-direction: row;
flex-direction: row;
-ms-flex-align: center;