Skip to content

Instantly share code, notes, and snippets.

View markomafs's full-sized avatar
:octocat:
Working from home

Marco Aurélio Ferreira de Souza markomafs

:octocat:
Working from home
View GitHub Profile
(ns playground
(:require [<service>.components :as b-comp]
[clojure.test :refer :all]
[com.stuartsierra.component :as component]
[common-core.system :as sys]
[criterium.core :as criterium]))
(defn run-criterium []
(criterium/with-progress-reporting (criterium/quick-bench (b-comp/create-and-start-system!) :verbose)))
(defn instrument-start [timings component]
@markomafs
markomafs / README-python-service-on-systemd-activated-socket.md
Created June 8, 2018 03:05 — forked from drmalex07/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.

@markomafs
markomafs / README-Template.md
Created May 9, 2017 21:43 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@markomafs
markomafs / configure_docker0.sh
Created November 8, 2016 20:04
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/fabiorphp/a94e0ea2558b3d10185d6d69d053c2b2/raw/configure_docker0.sh | sudo bash -s - 172.31.0.21/16
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
@markomafs
markomafs / WeightedHandleAdapter.php
Created November 19, 2015 18:04
How to Resolve WeightLoadBalance into Php Application
<?php
class Factory {
const W = 'W';
const LOAD_BALANCE_W = 'BALANCE_W';
const X = 'X';
const LOAD_BALANCE_X = 'BALANCE_X';
const Y = 'Y';
const LOAD_BALANCE_Y = 'BALANCE_Y';
const Z = 'Z';
const LOAD_BALANCE_Z = 'BALANCE_Z';
@markomafs
markomafs / ProgressBar.php
Last active August 29, 2015 13:59
Trait to Implement Progress Bar for CLI's
<?php
/**
* Progress Bar Trait
* @package Core\Traits
* @author Marco Souza<marco.souza@tricae.com.br>
*/
namespace Core\Traits;
# atualizar o repositório local
git pull
# entrar no branch
git checkout MASTER
# ele realizará e aplicar um diff entre os branch deixando os arquivos adicionados no git porém pedente de commit, ou seja não realizará um commit automatico do merge
git merge FEATURE_DE_77_COMMITS --squash
# faça um commit do branch com o comentário que bem entender e todos os commit's do outro branch seram ignorados