Skip to content

Instantly share code, notes, and snippets.

View barnslig's full-sized avatar

Leonard barnslig

  • Hamburg, Germany
View GitHub Profile
/**
* Turn an array into chunks
*
* @param {Array} arr - Array that should be chunked
* @param {number} size - Chunk size
* @returns {Array} Array of Arrays where each array has at max `size` elements
*/
const chunkify = (arr, size) =>
arr.reduce(
(acc, cur) =>
@barnslig
barnslig / redux-watch.js
Last active June 19, 2019 13:30
Subscribe to changes of part of a redux tree
import get from "lodash.get";
import isEqual from "lodash.isequal";
/**
* Subscribe to changes of part of a redux tree
*
* @example
* watch(Store, "dataset.currentId", id => {
* console.log(id);
* });
@barnslig
barnslig / schema.graphql
Last active January 15, 2019 00:29
GraphQL schema representing media.ccc.de
# An ISO 8601 encoded date string.
scalar Date
# An ISO 8601 encoded UTC date string.
scalar DateTime
# An RFC 3986, RFC 3987, and RFC 6570 (level 4) compliant URI string.
scalar URI
# An object with an ID.
import React from 'react';
import PropTypes from 'prop-types';
/**
* React component that keeps you up to date about navigator.onLine
*
* @example
* <Online>
* {isOnline => (isOnline ? <span>online!</span> : <span>offline!</span>)}
* </Online>
@barnslig
barnslig / blocklist.txt
Last active February 18, 2020 07:31
Nachrichtenseiten Drunterkommentare-Blockliste für uBlock
! zeit teaser comment count
zeit.de##.js-update-commentcount
! zeit main teaser
zeit.de##.teaser-classic__metadata *:nth-last-child(2):after
zeit.de##.teaser-dossier__metadata *:nth-last-child(2):after
zeit.de##.teaser-fullwidth__metadata *:nth-last-child(2):after
zeit.de##.teaser-large__metadata *:nth-last-child(2):after
zeit.de##.teaser-small-minor__metadata *:nth-last-child(2):after
zeit.de##.teaser-small__metadata *:nth-last-child(2):after
@barnslig
barnslig / Dockerfile
Last active May 19, 2018 10:28
compiler construction!
FROM ubuntu:artful
RUN apt-get update \
&& apt-get -y install build-essential llvm-4.0 clang libedit-dev libgmp-dev bison flex libz-dev ghc curl \
&& curl -sSL https://get.haskellstack.org/ | sh \
&& stack --resolver lts-8.13 --install-ghc install BNFC alex happy \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get -y install cmake libgtest-dev \
@barnslig
barnslig / Dockerfile
Created March 18, 2018 23:14
mathics!
FROM python:3-alpine
WORKDIR /usr/src/app
RUN pip install mathics
EXPOSE 8000
CMD ["mathicsserver", "-e"]
import noble from 'noble';
import binstruct from 'binstruct';
class CometBlue {
/**
* Constructor for a new CometBlue instance
*
* @param {array} services
*/
constructor(uuid, pin = '000000') {
<div class="my-large-element" data-parallax-speed="0.5"></div>
pkgname=acmetool
pkgver=0.0.50
pkgrel=0
pkgdesc="Acmetool is an easy-to-use command line tool for automatically acquiring certificates from ACME servers (such as Let's Encrypt)"
conflicts=('acmetool-git')
arch=('i686' 'x86_64')
source_i686=("https://github.com/hlandau/acme/releases/download/v${pkgver}/acmetool-v${pkgver}-linux_386.tar.gz")
source_x86_64=("https://github.com/hlandau/acme/releases/download/v${pkgver}/acmetool-v${pkgver}-linux_amd64.tar.gz")
sha256sums_i686=('e9813e95a1edfc312af921befbb549b95037749094c58447bb2b245e640f6497')
sha256sums_x86_64=('a5a22fcff5a306e67815b1692e0a10eed00a399c6a40f68c69f1e2e921f06a6d')