Skip to content

Instantly share code, notes, and snippets.

View tvlooy's full-sized avatar
🐧
<(o)

Tom Van Looy tvlooy

🐧
<(o)
View GitHub Profile
@JefClaes
JefClaes / gist:8975968
Last active August 29, 2015 13:56
Domain Event flavours
// Udi style w Static Domain Events
var dispatcher = new RecordingDomainEventsDispatcher();
DomainEvents.Dispatcher = dispatcher;
var customer = new Customer(new Address());
customer.Move(new Address());
Console.WriteLine("Customer moved: " + dispatcher.RecordedDomainEvent(new CustomerMoved()));
import Data.List (groupBy, sortBy)
getQuantity xs = let countQuantity acc (_, "registered") = succ acc
countQuantity acc (_, "sold") = pred acc
compareASC (i1, _) (i2, _)
| i1 < i2 = LT
| i1 > i2 = GT
| i1 == i2 = EQ
in map (foldl (countQuantity) 0) $ groupBy (\x y -> (fst x) == (fst y)) $ sortBy (compareASC) xs

##1. Setup docker

#Mac
https://docs.docker.com/installation/mac/

#Linux
https://docs.docker.com/installation/ubuntulinux/

##2. Setup docker-machine

@stasilok
stasilok / ocp.php
Created March 15, 2013 22:24 — forked from ck-on/ocp.php
<?php
/*
OCP - Optimizer+ Control Panel, by _ck_, stasilok
Version 0.0.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.0.6 2013-03-16 added opcache support (autodetect opcache or ZendOptimizerPlus functionality) (because of "ZendOptimizerPlus" is renamed to "opcache" to be merged into PHP-5.5) (stasilok)
0.0.5 2013-03-10 added refresh button (GK)
0.0.4 2013-02-18 added file grouping and sorting (click on headers) - code needs cleanup but gets the job done
@mzupan
mzupan / etc-default-uwsgi-graphite
Created March 20, 2013 19:26
graphite with nginx and uwsgi
PYTHONPATH=/opt/graphite/webapp/graphite
MODULE=graphite_uwsgi
@jakzal
jakzal / behat-runner.sh
Last active June 7, 2016 01:24
Running behat scenarios parallelized (by sprint)
#!/usr/bin/env bash
# finds all sprint tags (like @sprint:42) and runs them in a reversed order (won't run not tagged scenarios)
PARALLEL_COMMAND='parallel --gnu'
#PARALLEL_COMMAND='xargs -I{}'
BEHAT_COMMAND='./bin/behat --ansi --tags={}'
grep '@sprint:' features/*.feature | sed -e 's/.*\(@sprint:[0-9]*\).*/\1/' | sort -ur | $PARALLEL_COMMAND $BEHAT_COMMAND
anonymous
anonymous / answer.txt
Created August 27, 2016 11:24
I think the best way to answer this definitively without just handwaving
and talking about the C preprocessor is to actually write two small
example programs and compare the generated code from both. When I was
first learning C I did this constantly trying to understand how the
compiler worked. You don't need to understand assembly in great detail
to be able to spot differences in the output:
$ cat a.c
int main() {
char *line = "HTTP/1.0 500 Internal Server Error";
@andypiper
andypiper / amqpget.php
Created June 25, 2012 12:46
RabbitMQ test scripts
<?php
$cnn = new AMQPConnection();
$cnn->setLogin("guest");
$cnn->setPassword("guest");
$cnn->setHost("localhost");
if ($cnn->connect()) {
echo "Established a connection to the broker\n";
}
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
#
@ayushmishra2005
ayushmishra2005 / Read.md
Last active September 9, 2020 14:31
Store Scala Collection Into PostgreSQL using Slick

Open PostgreSQL and Create a table student in database student.

CREATE EXTENSION hstore;

CREATE TABLE student (
    id     int,
    name   varchar(254) NOT NULL,
    hobbies  text[],
    marks hstore
);