Skip to content

Instantly share code, notes, and snippets.

View djodjoni's full-sized avatar

Kalin Maldzhanski djodjoni

View GitHub Profile
@djodjoni
djodjoni / kafka.tf
Created April 9, 2018 20:12 — forked from vagelim/kafka.tf
Terraform for Kafka on DigitalOcean
resource "digitalocean_droplet" "kafka" {
image = "ubuntu-14-04-x64"
name = "${var.machine_name}"
region = "nyc2"
size = "4gb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
@djodjoni
djodjoni / wp.sh
Created January 26, 2018 12:36 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@djodjoni
djodjoni / index.html
Created December 7, 2017 15:35 — forked from rstacruz/index.html
D3 bubbles
<script src="https://raw.github.com/mbostock/d3/master/d3.js"></script>
<script src="https://raw.github.com/mbostock/d3/master/d3.layout.js"></script>
<div id="area"></div>
<style>
#area { background: #eee; width: 600px; height: 400px; }
circle { fill: #933; stroke-width: 2px; stroke: #fff; }
</style>
<script>
var canvas = d3.select("#area")
.append("svg:svg")
@djodjoni
djodjoni / README.md
Created December 7, 2017 14:27 — forked from davelandry/README.md
Simple Bubbles

From the D3 documentation:

Enclosure diagrams use containment (nesting) to represent the hierarchy. The size of each leaf node’s circle reveals a quantitative dimension of each data point. The enclosing circles show the approximate cumulative size of each subtree, but note that because of wasted space there is some distortion between levels; only the leaf nodes can be compared accurately. Although circle packing does not use space as efficiently as a treemap, the “wasted” space more prominently reveals the hierarchy.

Featured on D3plus.org

@djodjoni
djodjoni / Example.kt
Created November 21, 2017 17:28 — forked from elizarov/Example.kt
// https://akarnokd.blogspot.ru/2017/09/rxjava-vs-kotlin-coroutines-quick-look.html
import kotlinx.coroutines.experimental.*
suspend fun f1(i: Int): Int {
Thread.sleep(if (i != 2) 2000L else 200L)
return 1
}
suspend fun f2(i: Int): Int {
Thread.sleep(if (i != 2) 2000L else 200L)

Rough Notes about CQRS and ES

Once upon a time…

I once took notes (almost sentence by sentence with not much editing) about the architectural design concepts - Command and Query Responsibility Segregation (CQRS) and Event Sourcing (ES) - from a presentation of Greg Young and published it as a gist (with the times when a given sentence was heard).

I then found other summaries of the talk and the gist has since been growing up. See the revisions to know the changes and where they came from (aka the sources).

It seems inevitable to throw Domain Driven Design (DDD) in to the mix.

@djodjoni
djodjoni / HTML-presentation-tools.md
Created November 1, 2017 14:07 — forked from vasilisvg/HTML-presentation-tools.md
HTML presentation tools

#HTML presentation tools

There are many HTML presentation tools and they are all created for slightly different reasons. Here's an overview. Please let me know if I forgot any.

##CSSS

CSS-based SlideShow System

@djodjoni
djodjoni / firebase_detect_data.js
Created October 10, 2017 19:32 — forked from anantn/firebase_detect_data.js
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@djodjoni
djodjoni / ExecutionResult.cs
Created September 16, 2017 00:33 — forked from vladikk/ExecutionResult.cs
Command execution result object for CQRS based systems
using System;
namespace Example
{
public abstract class ExecutionResult
{
protected ExecutionResult(Guid aggregateId, Guid commandId, DateTime executedOn)
{
AggregateId = aggregateId;
CommandId = commandId;
@djodjoni
djodjoni / Install-php7.md
Created August 17, 2017 22:05 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions