Skip to content

Instantly share code, notes, and snippets.

View afraser's full-sized avatar

Adam Fraser afraser

  • Rocket Insights
  • Newburyport, MA
View GitHub Profile
@afraser
afraser / dabblet.css
Created July 12, 2012 19:29 — forked from mhodgson/dabblet.css
Boundless Plus v2 layout
/* Boundless Plus v2 layout */
body {
margin: 0;
background-color: #333;
height: 100%;
max-height: 100%;
}
header{
height: 100%;
max-height: 100%;
@afraser
afraser / dabblet.css
Created July 13, 2012 13:48 — forked from mhodgson/dabblet.css
Boundless Plus v2 layout - Hodgie
/* Boundless Plus v2 layout - Hodgie */
html {
height: 100%;
max-height: 100%;
}
body {
margin: 0;
background-color: #333;
height: 100%;
max-height: 100%;
@afraser
afraser / dabblet.css
Created July 20, 2012 18:09
Boundless Plus v2 layout - Hodgie
/* Boundless Plus v2 layout - Hodgie */
html {
height: 100%;
max-height: 100%;
}
body {
margin: 0;
background-color: #333;
height: 100%;
max-height: 100%;
@afraser
afraser / dabblet.css
Created July 25, 2012 11:45
ribbon banner
/**
* ribbon banner
*/
body{
background: #333;
padding: 35px 0 0;
position: relative;
}
.ribbon {
@afraser
afraser / dabblet.css
Created August 2, 2012 16:47
Toggle switch
/**
* Toggle switch
*/
*{
box-sizing: border-box;
}
input, textarea{
box-sizing: content-box;
}
body{
@afraser
afraser / dabblet.css
Created August 3, 2012 12:59
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
*{
+box-sizing(border-box)
}
input, textarea
+box-sizing(content-box)
.menu{x-sizing(border-box)
@afraser
afraser / dabblet.css
Created August 3, 2012 13:13
Scroll bug
/**
* Scroll bug
*/
*{
box-sizing: border-box;
}
input, textarea{
box-sizing: content-box;
}
import React, { Component, PropTypes } from 'react'
import Toolbar from 'containers/Toolbar'
import InlineMath, { forceUpdateEquation } from 'containers/InlineMath'
import EquationEditor from 'components/EquationEditor'
import { Editor, EditorState, ContentState, SelectionState, Entity, CompositeDecorator, Modifier, convertToRaw, RichUtils } from 'draft-js'
const SUPPORTED_COMMANDS = [ 'italic' ]
function findTex(contentBlock, callback) {
contentBlock.findEntityRanges(
@afraser
afraser / FileDropzone.js
Created September 13, 2019 15:46
FileDropzone
import React, { useState, useEffect, useRef } from 'react'
import cx from 'classnames'
import css from './FileDropzone.sass'
export function FileDropzone ({ onDrop, children }) {
const [dragging, setDragging] = useState(0)
const dropRef = useRef()
const handleDrag = evt => {
@afraser
afraser / draftjs_inline_equations.js
Last active May 11, 2021 02:05
Demonstrates inline equations with copy/paste supported in draft.js
<!--
Copyright (c) 2013-present, Facebook, Inc. All rights reserved.
This file provided by Facebook is for non-commercial testing and evaluation
purposes only. Facebook reserves all rights not expressly granted.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN