Skip to content

Instantly share code, notes, and snippets.

View DeMoorJasper's full-sized avatar
🛠️

Jasper De Moor DeMoorJasper

🛠️
View GitHub Profile
@DeMoorJasper
DeMoorJasper / model_metadata.json
Last active August 7, 2019 08:56
model_metadata
{
"action_space": [
{
"steering_angle": -30,
"speed": 2.5,
"index": 0
},
{
"steering_angle": -30,
"speed": 5.5,
@DeMoorJasper
DeMoorJasper / hmr.js
Created February 21, 2019 20:54
HMR Util
module.exports = function wrapHMR(module) {
if (module.hot) {
module.hot.dispose(() => {
window.location.reload();
});
}
return module;
}
import { stylish } from 'tiny-stylish-components';
let bg = '#ffffff';
let color = '#ffffff';
let randomColor = () => `#${Array.apply(null, Array(6)).map(el => '0123456789ABCDEF'[Math.floor(Math.random() * 16)]).join('')}`;
const Button = stylish.button`
background: ${bg};
color: ${color};
border: 1px solid ${randomColor()};
@DeMoorJasper
DeMoorJasper / extending.js
Created May 5, 2018 12:22
Stylish extending
import { stylish } from 'tiny-stylish-components';
const Button = stylish.button`
background: #ffffff;
color: #a2a2a2;
border: 1px solid #a2a2a2;
border-radius: 5px;
width: 100px;
padding: 5px 10px;
`;
@DeMoorJasper
DeMoorJasper / mediaqueries.js
Created May 5, 2018 12:21
Stylish media queries
import { stylish } from 'tiny-stylish-components';
const Button = stylish.button`
background: #ffffff;
color: #a2a2a2;
border: 1px solid #a2a2a2;
border-radius: 5px;
width: 100px;
padding: 5px 10px;
@media (max-width: 400px) {
@DeMoorJasper
DeMoorJasper / css event
Created May 5, 2018 12:20
stylish event
import { stylish } from 'tiny-stylish-components';
const Button = stylish.button`
background: #ffffff;
color: #a2a2a2;
border: 1px solid #a2a2a2;
border-radius: 5px;
width: 100px;
padding: 5px 10px;
&:hover {
@DeMoorJasper
DeMoorJasper / stylish.js
Created May 5, 2018 11:48
Stylish demo
import { stylish } from 'tiny-stylish-components';
const Button = stylish.button`
background: #ffffff;
color: #a2a2a2;
border: none;
`;
render() {
return <Button>I am a button! Click Me!</Button>;
const assertBundleTree = require('parcel-assert-bundle-tree');
const path = require('path');
const SveltePlugin = require('../src/index');
describe('basic', function() {
it('Should create a basic svelte bundle', async function() {
// Init bundler
const bundler = new Bundler(input, Object.assign({
outDir: path.join(__dirname, 'dist'),
watch: false,
const { compile, preprocess } = require('svelte');
const { Asset } = require('parcel-bundler');
class SvelteAsset extends Asset {
constructor(name, pkg, options) {
super(name, pkg, options);
this.type = 'js';
}
async generate() {
@DeMoorJasper
DeMoorJasper / parse.js
Last active May 3, 2018 09:50
Parsing svelte
const { compile, preprocess } = require('svelte');
async parse(inputCode) {
let svelteOptions = {
compilerOptions: {
generate: 'dom',
format: 'cjs',
store: true,
filename: this.relativeName,
css: false