Skip to content

Instantly share code, notes, and snippets.

View Haroenv's full-sized avatar

Haroen Viaene Haroenv

View GitHub Profile
/**
* Check whether a number is a multiple of a second
*
* @param {number} num the number to check
* @param {number} divisor the number over which it's dividable
*/
const isDivisible = (num, divisor) => num % divisor === 0;
/**
* Get the value (fizz, buzz, fizzbuzz, {number}) for a specific number
<template>
<div id="app" class="container-fluid">
<ais-index :searchStore="searchStore" :queryParameters="{clickAnalytics: true}">
<div class="row">
<div class="col-md-2 col-sm-3">
<h1 class="head-title">
Demo Store
</h1>
</div>
<div class="col-md-10 col-sm-9">
@Haroenv
Haroenv / response.json
Created December 19, 2017 09:05
An Algolia response with multi-query, snippeting and highlighting
{
"results": [
{
"hits": [
{
"start": 0,
"text": "",
"id": "B-r3Wf_I2Lk",
"title": "Things I learned teaching Go",
"description": "Filmed at http://dotgo.io in Paris on October 10, 2014. More talks at http://dotconferences.io\n\nFrancesc is a member of the Go team",
@Haroenv
Haroenv / README.md
Last active August 19, 2017 09:09
Magic lovely minifier

While making a library, I find it useful to write css in template strings to add as content to a style tag. This however means that when I add whitespace, it's going to be outputted in the library 🤔. What if Babel could minify that css while still allowing the expressivity of template strings?

I have the feeling that something like this is possible with babel-plugin-preval, but I'm not too sure how to do it without outputting the whole string that's generated

<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:url" content="https://yarnpkg.com/en/package/vue-instantsearch">
<meta property="og:site_name" content="Yarn">
<meta property="og:title" content="vue-instantsearch">
<meta property="og:image" content="https://yarnpkg.com/assets/og_image.png">
<meta property="og:description" content="👀 Lightning-fast Algolia search for Vue apps">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webpack Bundle Analyzer</title>
<!-- viewer.js -->
<script>
@Haroenv
Haroenv / dimoc.md
Created February 21, 2017 09:28 — forked from jamesgpearce/dimoc.md
DIMOC: Do It Myself or Callback - a simple pattern for React components

TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.

Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:

/* @flow */
var React = require('react');

var Letter: React.ReactClass = React.createClass({
  getInitialState: function(): any {
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.arc text {
font: 10px sans-serif;
text-anchor: middle;
}
.arc path {
stroke: #fff;
63
Data security (Theorie) [OI5013] + labo
Data security (Theorie) [OI5013] + labo inhoud Toets maken: Password cracking maxi
Menu Cursus verbergen
Data security (Theorie) [OI5013] + labo
inhoud
Uitleg bij het cursusmenu
@Haroenv
Haroenv / attractie.jsonld
Last active November 7, 2016 10:27
A JSON-LD possible output of an adventure park API. Using https://haroen.me/terms/
{
"@context": {
"@vocab": "http://schema.org/",
"in": "https://haroen.me/terms/interests#",
"ac": "https://haroen.me/terms/accessibility#",
"cn": "https://haroen.me/terms/constraints#",
"ageRange": "cn:ageRange",
"heightRange": "cn:heightRange",
"accessible": "ac:accessible",
"foaf": "http://xmlns.com/foaf/0.1/",