Skip to content

Instantly share code, notes, and snippets.

View arialdomartini's full-sized avatar

Arialdo Martini arialdomartini

View GitHub Profile
@arialdomartini
arialdomartini / max_without_comparators.cs
Last active September 20, 2017 09:43
Max of 2 numbers, without comparators and conditionals
using System;
using System.Collections.Generic;
using System.Linq;
namespace MyMax2
{
public class Maximizer
{
public int Max(int a, int b)
{
# Create an OSEv3 group that contains the masters and nodes groups
[OSEv3:children]
masters
nodes
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
@arialdomartini
arialdomartini / Finally.java
Created September 28, 2016 05:18
Guess the output
class Test {
public int aaa() {
int x = 1;
try {
return ++x;
} catch (Exception e) {
} finally {
++x;
~/prg/docker/qmk_firmware • docker run -e keymap=dvorak_programmer -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
make: Warning: File '.build/obj_ergodox_ez_dvorak_programmer/keyboards/ergodox/ergodox.d' has modification time 257 s in the future
make: warning: Clock skew detected. Your build may be incomplete.
avr-gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
WARNING:
Some git sub-modules are out of date or modified, please consider runnning:
package recfun
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
print(" " * (10 - row))
for (col <- 0 to row )
print(pascal(col, row) + " ")
println()
(defun sum (lat)
(cond
((eq lat ()) 0)
(t (+ (car lat) (sum (cdr lat))))
)
)
(sum '(1 2 3 4 5))
class MyClientFactory
{
Client _client;
public Client GetClient()
{
if(_client.State == CommunicationState.Faulted)
_client = new Client();
return _client;
}
[DataContract]
public class MyRequest
{
[DataMember]
public InnerClass AComplexField { get; set; }
}
[DataContract]
public class InnerClass
Verifying that +arialdomartini is my blockchain ID. https://onename.com/arialdomartini
HOSTN=some-rabbit
RABBITNODENAME=some-rabbit
docker run -d --hostname $HOSTN --name some-rabbit -e RABBITMQ_ERLANG_COOKIE='SECRET99182' -e RABBITMQ_NODENAME=$RABBITNODENAME rabbitmq:3.5.6
docker run -d --hostname $HOSTN --name some-rabbit-management --link some-rabbit -p 8080:15672 -e RABBITMQ_ERLANG_COOKIE='SECRET99182' -e RABBITMQ_NODENAME=$RABBITNODENAME rabbitmq:3.5.6-management
docker run -ti --hostname $HOSTN --name some-rabbit-client --link some-rabbit --dns 8.8.8.8 -v $(pwd)/pyth:/var/pyth -e RABBITMQ_ERLANG_COOKIE='SECRET99182' -e RABBITMQ_NODENAME=$RABBITNODENAME rabbit-client /bin/bash