Skip to content

Instantly share code, notes, and snippets.

View wodCZ's full-sized avatar

Martin Janeček wodCZ

View GitHub Profile
@wodCZ
wodCZ / Metricbeat aws module permissions
Created May 28, 2020 08:44 — forked from asjadathick/Metricbeat aws module permissions
AWS IAM policy for metricbeat aws module metricsets
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:DescribeRegions",
"cloudwatch:GetMetricData",
@wodCZ
wodCZ / async-foreach.ts
Last active November 21, 2019 13:36 — forked from atinux/async-foreach.js
JavaScript: async/await with forEach()
export async function asyncForEach<T>(array: T[], callback: (item: T, index: number, allItems: T[]) => void) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
@wodCZ
wodCZ / getChange.php
Last active September 17, 2016 18:42 — forked from algb12/getChange.php
<?php
// This function takes an array of denominators for a currency and a sum, and returns an array describing the most efficient way to express the sum in terms of denominations.
// E.g. A sum, such as 200 EUR can be expressed in terms of 100x2, which is inefficient, as there is the denomination 200 for this job.
// The function will return the most efficient way to express the sum, not 100x2, but 200x1.
// Recommended to round both, the expected and actual value to 2 decimal places.
// FUNCTION
// getChange function
function getChange($sum, $denominations) {
@wodCZ
wodCZ / 01-server-config-in-git.md
Created February 11, 2016 14:47 — forked from juzna/01-server-config-in-git.md
Server Configuration in git

Server Configuration in git

With git you can have anything versioned. You're used to version your code, which is a bunch of files. Your server configuration (on Linux) is also just a bunch of files, so it can be versioned as well.

The idea is simple: create a git repository in /etc/ and commit everytime you change any configuration of your server. Written in code:

cd /etc
git init
git add .
<?php
use Kdyby;
use Kdyby\RabbitMq\Connection;
use Kdyby\RabbitMq\DI\RabbitMqExtension;
use Nette;
use Nette\Reflection\ClassType;
use PhpAmqpLib\Message\AMQPMessage;
use Tester;
@wodCZ
wodCZ / ubuntu-php-development-environment.md
Created October 25, 2015 14:18 — forked from DaRaFF/ubuntu-php-development-environment.md
Ubuntu php development environment

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

Responsive and friendly table

It's a display of tabular data, using divs because I needed a nice and friendly display for mobile.

Color coding, badges and icons

A Pen by Laura Moraiti on CodePen.

License.