Skip to content

Instantly share code, notes, and snippets.

View dannykopping's full-sized avatar

Danny Kopping dannykopping

View GitHub Profile
@dannykopping
dannykopping / SLI-panel.json
Created August 21, 2023 12:18
SLI-panel.json
{
"datasource": {
"uid": "mimir",
"type": "prometheus"
},
"type": "gauge",
"title": "SLI",
"gridPos": {
"x": 0,
"y": 0,
goos: linux
goarch: amd64
pkg: github.com/go-kit/log
cpu: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
BenchmarkLineBuffered/capacity:1-8 718952 1572 ns/op 96 B/op 2 allocs/op
BenchmarkLineBuffered/capacity:2-8 1044774 1228 ns/op 96 B/op 2 allocs/op
BenchmarkLineBuffered/capacity:4-8 1401778 867.3 ns/op 96 B/op 2 allocs/op
BenchmarkLineBuffered/capacity:8-8 1666798 699.2 ns/op 96 B/op 2 allocs/op
BenchmarkLineBuffered/capacity:16-8 1856240 614.9 ns/op 96 B/op 2 allocs/op
BenchmarkLineBuffered/capacity:32-8 2029083 561.8 ns/op 96 B/op 2 allocs/op
# before
$ rubocop -c .rubocop.yml
Inspecting 7 files
..CCWC.
Offenses:
docker/Gemfile:6:1: C: [Correctable] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem fluentd should appear before fluent-plugin-multi-format-parser.
gem 'fluentd', '1.9.0'
^^^^^^^^^^^^^^^^^^^^^^
@dannykopping
dannykopping / merger.php
Created August 2, 2011 23:35
Merge audio and video FLV scripts with PHP and FFMPEG
<?php
$streamsPath = realpath("/usr/share/red5/webapps/vod/streams");
$videoFile = "$streamsPath/356a192b7913b04c54574d18c28d46e6395428ab-1312327917237_Video.flv";
$audioFile = "$streamsPath/356a192b7913b04c54574d18c28d46e6395428ab-1312327917237_Audio.flv";
// convert audio FLV to mp3
$targetAudio = dirname(realpath($audioFile))."/audio.mp3";
system("ffmpeg -y -i $audioFile -ac 2 -ab 128kb $targetAudio");
@dannykopping
dannykopping / convert.php
Created October 8, 2011 21:27
Convert RTF and MS Word Text to UTF8
$output = iconv('UTF-8', 'ASCII//TRANSLIT', $input);
<?php
require 'vendor/autoload.php';
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\DefinitionBuilder;
use Symfony\Component\Workflow\Event\Event;
use Symfony\Component\Workflow\Event\GuardEvent;
use Symfony\Component\Workflow\EventListener\AuditTrailListener;
@dannykopping
dannykopping / build.xml
Created April 7, 2012 00:10
Phing Behat Task
<?xml version="1.0" encoding="UTF-8"?>
<project name="ci-phing-behat-test" default="dev">
<!-- load variable definitions -->
<property file="build.properties"/>
<property name="behat.basedir" value="${project.basedir}/../test"/>
<!-- define custom tasks and types -->
<typedef name="args" classname="phing.behat.types.BehatArguments"/>
@dannykopping
dannykopping / data.sql
Created October 8, 2011 16:01
Jaro-Winkler Blog Post data
# ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.1.44)
# Database: blog_tests
# Generation Time: 2011-10-08 18:00:24 +0200
@dannykopping
dannykopping / ansi-color.php
Created June 15, 2016 14:17 — forked from superbrothers/ansi-color.php
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
performance_schema = 0
table_definition_cache = 400