Skip to content

Instantly share code, notes, and snippets.

View samuel-holt's full-sized avatar

Samuel Holt samuel-holt

View GitHub Profile
@samuel-holt
samuel-holt / app.jsx
Created October 11, 2017 04:02
React Error boundaries
import { Dashboard, DashboardPanel } from './dashboard';
import { getStore } from './store';
import { ErrorBoundaryAppContainer } from './errorBoundary';
class App extends React.Component {
state = {
currentStore: getStore(),
numPanels: 7
};
import c3 from 'c3';
export function charts() {
const errorChart = c3.generate({
bindto: '.js-chart',
data: {
x: 'date',
y: 'errors',
url: './data/dummydata.json',
@samuel-holt
samuel-holt / _mixins.scss
Last active November 23, 2016 18:58
Responsive typography
// STRIP UNIT
// It strips the unit of measure and returns it
@function strip-unit($num) {
@return $num / ($num * 0 + 1);
}
// Media queries mixin
// Default widths
$default-medium: 768px !default;
@samuel-holt
samuel-holt / _color-palette.scss
Last active January 10, 2022 07:57
Dynamic color palette mixin
// =================================
// Color palette generator
// =================================
// Muck around with colors here:
$primary-color: salmon;
// A global to store the palette(s)
$global-color-palettes: () !global;
@samuel-holt
samuel-holt / _rem-font.scss
Created November 20, 2014 22:42
Rem font mixin
$legacy-support: ie8 ie9 !default;
// This is the default html and body font-size for the base rem value.
$rem-base: 16px !default;
$line-height-base: 1.8 !default;
// REM calculation courtesy of Zurb Foundation :)
// CONVERT TO REM
@function convert-to-rem($value, $base-value: $rem-base) {
@samuel-holt
samuel-holt / _font.scss
Created November 20, 2014 20:06
Full font face generator mixin
// Set defaults in parameters...
@mixin generate-font-face($font-name, $sizes:false, $font-folder-name:false, $font-file-prefix: false, $font-file-suffix: "webfont", $font-name-separator:"-", $dir-separator:"/", $formats:(woff2, ttf, svg, eot)) {
$web-font-folder-name: $font-name;
@if $font-folder-name != false {
$web-font-folder-name: $font-folder-name;
}
// default font-file prefix