Skip to content

Instantly share code, notes, and snippets.

View Breta01's full-sized avatar
🤹
All over the place

Bretislav Hajek Breta01

🤹
All over the place
View GitHub Profile
import React from 'react';
import Chart from 'chart.js';
import moment from 'moment';
const LineGraph = React.createClass({
createChart: function() {
const data = this.props.data;
// Extracting data from properties
var val = data.map(a => a.score);
import React from 'react'
const Example = () => (
<div>
<h2>Text</h2>
{/*
You just have to place your comment
between two curly braces
*/}
</div>
import React from 'react';
import Table from './Table';
const Dashboard = React.createClass({
// Function where the magic happens :D
sort_by: function(field, reverse, primer) {
var key = primer ? function(x) {return primer(x[field])} :
function(x) {return x[field]};
reverse = !reverse ? 1 : -1;
import React from 'react';
// Gamecard based on MDL Cards
const Gamecard = React.createClass({
render: function() {
// JS object containing CSS like syntax
// We can use other variables in it (e.g. props)
const CardImage = {
height: '175px',
background: 'url("' + this.props.image + '") center / cover'
};
@Breta01
Breta01 / build.json
Last active November 16, 2016 19:39
Include in package.json
"build": {
"appId": "org.breta.MemoryKing",
"category": "public.app-category.education",
"files": [
"dist/",
"node_modules/",
"static/",
"main.js",
"index.html",
"package.json"
@Breta01
Breta01 / dir.json
Created November 16, 2016 19:39
Include in package.json
"directories": {
"output": "release"
},
@Breta01
Breta01 / appveyor.yml
Created November 16, 2016 20:38
Simplified appveyor settings
os: unstable
cache:
- node_modules
environment:
GH_TOKEN:
secure: fK836CflhDBugnKO8/6bb/97NGIsR/E8Y3e
matrix:
- nodejs_version: 6
install:
- ps: Install-Product node $env:nodejs_version
@Breta01
Breta01 / .travis.yml
Created November 16, 2016 20:58
Simplified .travis.yml
sudo: required
dist: trusty
language: c
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
@Breta01
Breta01 / scripts.json
Created November 16, 2016 21:46
Include in package.json > scripts
"postinstall": "install-app-deps",
"dist": "npm run build && build --publish onTagOrDraft"
@Breta01
Breta01 / Example_page.tex
Last active January 8, 2017 15:17
Example LaTeX page
\documentclass{article}
\begin{document}
\title{Example Page}
\author{Breta}
\maketitle
\begin{abstract}
This is the example page.
\end{abstract}