Skip to content

Instantly share code, notes, and snippets.

const os = require('os')
const Benchmark = require('benchmark') // https://github.com/bestiejs/benchmark.js
console.log(`cpu: ${os.cpus()[0].model}`)
console.log(`NodeJS version: ${process.version}`)
console.log(`platform: ${os.platform()}`)
console.log()
const suite = new Benchmark.Suite()
@spddl
spddl / *.js
Created February 26, 2019 12:06
var a = [1, 2, 3, 4, 5, 6, 7]
var b = ['a', 'b', 'c']
al = a.length
bl = b.length
console.log(al, bl) // 7 3
if (al < bl) {
for (let i = 0, len = (bl - al); i < len; i++) {
a.push('')
@spddl
spddl / php1.php
Last active December 8, 2018 15:32
<?php
// Zeile für Zeile
$i = 1;
echo "<div class='col-xs-10'>"; // Das Diagramm
while ($i <= 7) {
?>
@spddl
spddl / app.js
Created November 3, 2018 15:50
REST API + LowDB
'use strict'
const port = process.env.PORT || 8080
const express = require('express') // https://expressjs.com/de/
const bodyParser = require('body-parser') // https://www.npmjs.com/package/body-parser
const cors = require('cors') // https://www.npmjs.com/package/cors
const app = express()
@spddl
spddl / new_task.js
Last active July 11, 2018 11:01
amqp
#!/usr/bin/env node
// https://www.rabbitmq.com/tutorials/tutorial-two-javascript.html
var amqp = require('amqplib/callback_api')
const arr = ['1', '2', '3', '4', '5', '6', '7', '{a, "b"}'] // {a: 'b'}, ['a', 'b']
amqp.connect('amqp://localhost', function (err, conn) {
if (err) console.warn(err)
conn.createChannel(function (err, ch) {
if (err) console.warn(err)
@spddl
spddl / grundlagen.md
Last active January 2, 2025 14:53
Markdown-Spickzettel

Markdown wurde mit den Grundgedanken konzipiert, so einfach lesbar und schreibbar wie möglich zu sein.

Lesbarkeit ist hierbei das oberste Ziel. Ein Markdown-formatiertes Dokument sollte in seiner Grundform veröffentlicht werden können, ohne den Anschein zu erwecken, es sei mit Tags oder Formatierungsbefehlen versehen (wie es bei HTML der Fall ist).

Grundlagen

Text formatieren:
(Eingabe)
Normal 
/*
(4) 2018 M05
Mo Di Mi Do Fr Sa So
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
@spddl
spddl / iris.go
Created February 1, 2018 19:45
Iris Webspace
package main
import (
"net/url"
"github.com/iris-contrib/middleware/cors"
"github.com/kataras/iris"
"github.com/kataras/iris/core/host"
"github.com/kataras/iris/middleware/logger"
)
{
"wie machtn der das?": "https://clips.twitch.tv/JollyAstuteDoveNerfBlueBlaster",
"na endlich": "https://clips.twitch.tv/ResourcefulOilyHorseradishSeemsGood",
"OK neuer Plan schnap dir den RL": "https://clips.twitch.tv/EphemeralCloudyMinkJonCarnage",
"Ohne erlaubnis ins gesicht geschossen": "https://clips.twitch.tv/SlickFaintRedpandaOSkomodo",
"nicht mal nageln kann man den typ": "https://clips.twitch.tv/LachrymoseUnsightlyMetalPrimeMe",
"Das Auge zeigen": "https://clips.twitch.tv/PeppyRenownedBeanEagleEye",
"schon wieder der spddl": "https://clips.twitch.tv/CourageousElegantGooseVoHiYo",
"schon wieder der spddl wer ist der mann": "https://clips.twitch.tv/WiseSwissShieldRitzMitz",
"ich zeig euch mal die RailGun": "https://clips.twitch.tv/CrypticEnthusiasticDootCurseLit",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>background-color</title>
<style>
.container-grun {
background-color: green;
}
</style>