Skip to content

Instantly share code, notes, and snippets.

View gitumarkk's full-sized avatar

Mark Gituma gitumarkk

  • Toronto, Canada
View GitHub Profile
"""
This module contains objects (mainly filepaths) to be used by other modules.
"""
import os
import datetime as dt
from pathlib import Path
os.chdir(os.path.dirname(os.path.abspath(__file__)))
/* eslint-disable no-empty, no-console */
import * as Sentry from '@sentry/react-native';
const ENABLE_LOG = __DEV__;
export default {
info: (...args: any): void => {
if (ENABLE_LOG) console.log(...args);
},
error: (...args: any): void => {
from datetime import date
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from custom_components import MyCustomComponent, MyEditor, MyCalendar
external_stylesheets = ["https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"]
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
/* eslint-disable import/prefer-default-export */
import MyCustomComponent from './components/MyCustomComponent.react';
import MyEditor from './components/MyEditor.react';
import MyCalendar from './components/MyCalendar.react';
export {MyCustomComponent, MyEditor, MyCalendar};
import React from 'react';
import PropTypes from 'prop-types';
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';
/**
* MyEditor is a quill editor.
*/
const MyEditor = ({id, setProps, value}) => {
import React from 'react';
import PropTypes from 'prop-types';
import dayjs from 'dayjs';
import Calendar from 'react-calendar';
import 'react-calendar/dist/Calendar.css';
/**
* MyCalendar allows the user to select a date
*/
import React, {Component} from 'react';
import PropTypes from 'prop-types';
export default class MyCustomComponent extends Component {
render() {
const {id, label, setProps, value} = this.props;
return (
<div id={id}>
@gitumarkk
gitumarkk / python-dash-custom-components-step-2-app.py
Created June 10, 2021 20:39
python-dash-custom-components-step-2-app.py
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from custom_components import MyCustomComponent
external_stylesheets = ["https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"]
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
function App () {
const dispatch = useDispatch();
const [currentVideo, setVideo] = useState(null);
const videoList = useSelector(state => state.app.videoList);
const queue = useSelector(state => state.app.queue);
useEffect(() => {
dispatch(getVideosApi());
dispatch(uploadNext(true));
}, []);
import { createStore, applyMiddleware, combineReducers } from 'redux';
import thunkMiddleware from 'redux-thunk';
import { ProcessingManager } from 'react-native-video-processing';
import storage from '@react-native-firebase/storage';
import * as mockApi from './mock-api';
const ADD_QUEUE_QUEUE = 'ADD_QUEUE_QUEUE';
const SET_CURRENT_STATE = 'SET_CURRENT_STATE';
const REMOVE_FROM_QUEUE = 'REMOVE_FROM_QUEUE';
const SET_VIDEO_LIST = 'SET_VIDEO_LIST';