Skip to content

Instantly share code, notes, and snippets.

View sandrokeil's full-sized avatar

Sandro Keil sandrokeil

View GitHub Profile
@codeliner
codeliner / MongoConnection.php
Last active May 9, 2022 14:55
prooph MongoEventStore v7
<?php
declare(strict_types = 1);
namespace Acme\Infrastructure\MongoDb;
use MongoDB\Client;
use MongoDB\Collection;
class MongoConnection
@mjnaderi
mjnaderi / install-arch.md
Last active April 18, 2024 19:00 — forked from mattiaslundberg/arch-linux-install
Installing Arch Linux with Full Disk Encryption (LVM on LUKS)

Installing Arch Linux with Full Disk Encryption

If you're aiming for a seamless Arch Linux installation in UEFI mode, follow along as this guide will walk you through the process step by step. We'll be using LUKS (Linux Unified Key Setup) and LVM (Logical Volume Manager) partitions on LUKS to achieve full disk encryption.

Note: I have updated this doc for UEFI mode. For those with BIOS/MBR systems, you can refer to the previous version, but keep in mind that it might be outdated and no longer accurate.

If you're only interested in installing Linux and not setting up dual boot with Windows, feel free to skip the Windows-related sections.

@saurshaz
saurshaz / aws-uploader.html
Last active October 3, 2016 15:50
aws-uploader riot component with server side code
const riot = require('riot')
<aws-uploader>
<div class='container'>
<form method="POST" action="/save-details">
<input type="file" id="file-input" onchange={initUpload}>
<p id="status">Please select a file</p>
<section if={opts.imagefile === 'true'}>
<img style="border:1px solid gray;width:300px;" id="preview" src="/images/default.png">
<input type="hidden" id="avatar-url" name="avatar-url" value="/images/default.png">
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active April 23, 2024 02:03
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
import groovy.transform.Field
import hudson.AbortException
import hudson.scm.SubversionSCM
import org.tmatesoft.svn.core.SVNDepth
import java.util.concurrent.ConcurrentHashMap
@Field int slaves = 4;
@Field int threadsPerSlave = 2;
@Field boolean coverageBuild = false
<?php
namespace Ipark\ApplicationBundle\Messaging\ServiceBus\Infrastructure;
use Ipark\FrameworkBundle\Common\SecurityHelper;
use Prooph\Common\Messaging\NoOpMessageConverter;
use Prooph\ServiceBus\CommandBus;
use Prooph\ServiceBus\Plugin\Auditing\CommandAuditor;
use Prooph\ServiceBus\Plugin\Auditing\RawMessageSerializer;
use Prooph\ServiceBus\Plugin\Auditing\SecretMessageSerializer;
use Prooph\ServiceBus\Plugin\Router\RegexRouter;

Important: At the time of writing (2019-11-11) Immutable.js is effectively abandonware, so I can no longer recommend anyone to follow the advice given here. I'll leave the article here for posterity, since it's still getting some traffic.

Understanding Immutable.Record

Functional programming principles and with it immutable data are changing the way we write frontend applications. If the recent de-facto frontend stack of React and Redux feels like it goes perfectly together with immutable data, that's because it's specifically designed for that.

There's several interesting implementations of immutable data for JavaScript, but here I'll be focusing on Facebook's own Immutable.js, and specifically on one of i

// Disable VirtualBox authentication
VBoxManage setproperty websrvauthlibrary null
// Start SOAP service so REX-Ray can talk to VirtualBox from the container host VMs
/Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv -H 0.0.0.0 -v
// Create a Swarm cluster
docker-machine create --driver=virtualbox default
eval $(docker-machine env default)
TOKEN=$(docker run --rm swarm create)
@rmtsrc
rmtsrc / postgres-json-cheatsheet.md
Last active October 22, 2023 12:16
Using JSON in Postgres by example

PostgreSQL JSON Cheatsheet

Using JSON in Postgres by example.

Quick setup via Docker

  1. Download and install: Docker Toolbox
  2. Open Docker Quickstart Terminal
  3. Start a new postgres container:
    docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
FROM codeship/ruby
MAINTAINER Dave Mox <dave.e.mox@gmail.com>
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
vim
COPY Makefile /src/