Skip to content

Instantly share code, notes, and snippets.

View borjapazr's full-sized avatar
🐮
Éche o que hai!

Borja Paz Rodríguez borjapazr

🐮
Éche o que hai!
View GitHub Profile
@eulerfx
eulerfx / PurchaseOrder.cs
Last active September 10, 2024 18:57
An example or a DDD application service.
// A repository.
public interface IPurchaseOrderRepository
{
PurchaseOrder Get(string id);
// The commit method would likely be moved to a Unit of Work managed by infrastructure.
void Commit();
}
// A marker interface for a domain event.
public interface IDomainEvent { }
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@mikeclarke
mikeclarke / env.sh
Created November 23, 2013 21:43
Wrapper script for dealing with environment variables set by the `-link container_name:db` argument. The Dockerfile `ENV` directive will set a static environment variable inside the container, but it's not possible to reference dynamic environment variables (at least not very easily) with ENV. This script should be set as the `ENTRYPOINT` in an …
#!/bin/bash
# Docker doesn't have a great way to set runtime environment variables,
# so use this script to prepare the execution environnment for later processes.
export SQLALCHEMY_DATABASE_URI="postgresql://${DB_PORT_5432_TCP_ADDR}:5432/database_name"
# Execute the commands passed to this script
# e.g. "./env.sh venv/bin/nosetests --with-xunit
exec "$@"
@mischah
mischah / z.md
Last active December 9, 2022 02:11
Installing und initializing z (https://github.com/rupa/z) with help of Homebrew.

#The power of z

Do you spend lots of time doing things like this?

cd this/is/the/path/that/i/want/so/i/type/it/all/out/to/get/whereiwant

With z, you could just do this:

@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@ctechols
ctechols / compinit.zsh
Last active March 28, 2025 04:16
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@domingogallardo
domingogallardo / aprobar-pull-request-bitbucket.adoc
Last active January 17, 2022 11:01
Flujo de trabajo con Git para gestionar y aprobar un Pull Request (PR) en un repositorio remoto compartido en Bitbucket

Veamos un flujo de trabajo con Git para gestionar y aprobar un Pull Request (PR) en un repositorio remoto compartido. El flujo de trabajo se ha comprobado que funciona correctamente en repositorios remotos gestionados en Bitbucket.

Suponemos un equipo formado por 3 desarrolladores (Ana, Lucía y Carlos) que están trabajando sobre un repositorio compartido utilizando el flujo de trabajo denominado Gitflow (ver el post de Vicent Driessen). En la rama develop se integran las features que se van desarrollando en ramas independientes.

Se ha definido la política de que antes de integrar una rama de característica se debe realizar un Pull Request en Bitbucket y algún otro miembro del equipo debe comprobar su funcionamiento y dar el visto bueno. La integración la realizará el mismo desarrollador que ha creado el Pull Request. Aunque Bitbucket proporciona la opción de cerrar el PR desde la interfaz web, utilizaremos comandos Git en e

Academic/Background
------------------------------------------------------------------------------------------------------------
Software Architecture, Perspectives on an emerging discipline - Mary Shaw, David Garlan
Introduction / Practice within Business
------------------------------------------------------------------------------------------------------------
Software Architecture in Practice - Len Bass, Paul Clements, Rick Kazman
In depth handbook for reaching requirements
------------------------------------------------------------------------------------------------------------
@bellbind
bellbind / pem.js
Last active September 17, 2024 20:19
[nodejs]Example of RSA usages with node-forge
// RSA with node-forge
"use strict";
// npm install node-forge
const forge = require("node-forge");
new Promise((f, r) => forge.pki.rsa.generateKeyPair(
2048, (err, pair) => err ? r(err) : f(pair)))
.then(keypair => {
const priv = keypair.privateKey;