Skip to content

Instantly share code, notes, and snippets.

View martinkr's full-sized avatar

martin krause martinkr

View GitHub Profile
(function() {
var css = [
'/css/default.css',
'/css/section.css',
'/css/custom.css'
],
i = 0,
link = document.createElement('link'),
head = document.getElementsByTagName('head')[0],
tmp;
@martinkr
martinkr / Vagrantfile
Created November 30, 2015 15:01
Vagrant: a simple setup with ngnix and php
# -*- mode: ruby -*-
# vi: set ft=ruby :
# "./Vagrantfile"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
# set ports: according to your ngnix configuration
config.vm.network :forwarded_port, guest: 8080, host: 8080
@martinkr
martinkr / Vagrantfile
Last active December 1, 2015 11:21
Vagrant: typical front end setup with ngnix / git / node / npm / gulp / bower / phantomjs / karma
# -*- mode: ruby -*-
# vi: set ft=ruby :
# "./Vagrantfile"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
# set ports: according to your ngnix configuration
config.vm.network :forwarded_port, guest: 8080, host: 8080
@martinkr
martinkr / react-lifecycle-block-start.js
Last active May 27, 2019 11:48
The original Gutenberg-Block from create-guten-block before the modifications.
/**
* BLOCK: react-lifecycle-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
import './style.scss';
import './editor.scss';
@martinkr
martinkr / react-lifecycle-block-done.js
Created May 27, 2019 11:48
The modified Gutenberg-Block from create-guten-block as react component.
/**
* BLOCK: react-lifecycle-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
import './style.scss';
import './editor.scss';
@martinkr
martinkr / index.html
Created October 24, 2021 16:32
1 line of code: How to count all occurrences in an Array (http://jsbench.github.io/#fd9adc367fcdc018994702e8becb038f) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>1 line of code: How to count all occurrences in an Array</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@martinkr
martinkr / index.html
Last active November 1, 2021 19:44
1 line of code:Array/indexOfLowestNumber #jsbench #jsperf (http://jsbench.github.io/#ac1df98815e154b99f1bbca18c089170) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>1 line of code:Array/indexOfLowestNumber #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@martinkr
martinkr / index.html
Created November 1, 2021 19:45
1 line of code: How to split an Array in half (http://jsbench.github.io/#44d4426b04ed29253d64e5ab813cfa28) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>1 line of code: How to split an Array in half</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>