Skip to content

Instantly share code, notes, and snippets.

@yanickrochon
yanickrochon / SignaturePad.jsx
Last active Apr 12, 2021
Material UI integration of react-signature-canvas (https://github.com/agilgur5/react-signature-canvas)
View SignaturePad.jsx
import React, { useEffect, useRef, useState } from 'react';
import PropType from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import classNames from 'classnames';
import Fade from '@material-ui/core/Fade';
import FormControl from '@material-ui/core/FormControl';
import IconButton from '@material-ui/core/IconButton';
import InputLabel from '@material-ui/core/InputLabel';
@yanickrochon
yanickrochon / flexboxgrid.css
Last active Dec 4, 2016
This, to me, solves the issue of horizontal scroll bars with Flexbox Grid. As long as Grid wraps the page content, everything seems to be fine so far.
View flexboxgrid.css
:root {
--gutter-width: 1;
--gutter-compensation: calc((var(--gutter-width) * 0.5) * -1);
--half-gutter-width: calc((var(--gutter-width) * 0.5));
--container-sm: 46.5em;
--container-md: 63em;
--container-lg: 74em;
}
@custom-media --sm-viewport only screen and (min-width: 48em);
@yanickrochon
yanickrochon / User.cs
Created Nov 28, 2013
Example my "issue" with C#'s naming convention. While most modern language have a "camel case" convention, C# uses an "upper camel case" (or "pascal case") convention. This cause problem when translating from, let say, JavaScript (JSON), or XML into C#.
View User.cs
public class User {
// composed class
public enum UserRole {
Guest = 0,
Subscriber = 1,
Supervisor = 2,
Editor = 3,
Publisher = 4,
Administrator = 5