Skip to content

Instantly share code, notes, and snippets.

View junkycoder's full-sized avatar

Dan Hromada junkycoder

  • Česká republika
View GitHub Profile
@junkycoder
junkycoder / .bashrc
Last active April 25, 2016 12:00
Raspberry Pi - full screen browser
# ...
# Run the browser
if [ $(tty) == /dev/tty1 ]; then
xinit ./run_browser.sh
fi
@junkycoder
junkycoder / .babelrc
Last active April 14, 2016 09:02
Material-UI's styleResizable mixin as a decorator
{
"presets": ["es2015", "react"],
"plugins": [
"transform-class-properties",
"transform-function-bind",
"transform-runtime",
"transform-object-rest-spread"
]
}
@junkycoder
junkycoder / chart.d3.js
Last active August 29, 2015 14:26
Reusable D3 chart
import d3 from 'd3';
import {responsivefy} from './lib';
export default function Chart(node, options, initialData) {
const [width, height] = [
options.width - options.margin.left - options.margin.right,
options.height - options.margin.top - options.margin.bottom
];
function chart(data) {
@junkycoder
junkycoder / record.js
Created July 23, 2015 10:29
Use React Prop Types to validate Immutable Records
import React from 'react';
import Immutable from 'immutable';
import {Record, Map} from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import merge from 'merge';
export const PropTypes = merge(ImmutablePropTypes, React.PropTypes);
export function alteredRecord(...args) {
const methods = [
// Prints size of free space in localStorage
(1024 * 1024 * 5 - unescape(encodeURIComponent(JSON.stringify(localStorage))).length)/1024/1024