Skip to content

Instantly share code, notes, and snippets.

View fernaspiazu's full-sized avatar
🧉

Fernando A. fernaspiazu

🧉
View GitHub Profile
@fernaspiazu
fernaspiazu / dettach-docker-container.txt
Last active August 27, 2015 09:18
How to detach from a running container keeping it running
Ctrl+P+Q detaches from a docker container without stopping it.
To be consistent with every other docker command Ctrl+C terminates the process/container and Ctrl+P+Q detaches.
Based on this discussion: https://github.com/docker/docker/issues/2855
@fernaspiazu
fernaspiazu / MongoDBManager.java
Last active November 14, 2015 01:05
A really well done Singleton??? I think it is :-)
/**
* <a href="https://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom">
* Initialization on-demand Holder idiom.
* </a>
*/
public class MongoDBManager {
private static final String MONGODB_CONNECTION_URL = "mongodb.connection.url";
public static MongoDBManager getInstance() {
return LazyHolder.INSTANCE;
@fernaspiazu
fernaspiazu / company_docker_machine.sh
Last active June 1, 2016 08:27
Create Docker-machine behind proxy with cntlm
#!/bin/bash
VM=company
HOST=<cntlm_or_proxy_host>
PORT=<cntlm_or_proxy_port>
docker-machine create \
--engine-env HTTP_PROXY=http://$HOST:$PORT \
--engine-env HTTPS_PROXY=http://$HOST:$PORT \
@fernaspiazu
fernaspiazu / 1_docker-mongodb-replica-set.yml
Last active May 31, 2016 23:28
Build and configure a replica set environment with MongoDB
version: '2'
services:
shard00_rs0_mongod:
image: mongo
restart: always
container_name: shard00_rs0_mongod
volumes:
- shard00_rs0_data:/data/db
networks:
@fernaspiazu
fernaspiazu / test-circe.scala
Created September 21, 2017 22:11
Surely, someone else found this solution... For ME it's an important discovery.
import io.circe.generic.auto._
import io.circe.syntax._
case class MoreThan22(
a1: Int, a2: Int, a3: Int, a4: Int, a5: Int, a6: Int, a7: Int, a8: Int, a9: Int, a10: Int,
a11: Int, a12: Int, a13: Int, a14: Int, a15: Int, a16: String, a17: Int, a18: Int, a19: Int, a20: Int,
a21: Int, a22: Int, a23: Int, a24: Int, a25: Int, a26: Int, a27: ComposedObj, a28: Int, a29: Int, a30: Int
)
case class ComposedObj(country: String, city: String)
@fernaspiazu
fernaspiazu / gist:87e143ab1e0abbbe421f00e1942a2553
Created December 12, 2018 22:59 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: