Skip to content

Instantly share code, notes, and snippets.

View ronnycoding's full-sized avatar
🇻🇪
The only way to do great work is to love what you do.

Ronny Freites ronnycoding

🇻🇪
The only way to do great work is to love what you do.
View GitHub Profile
version: '3.1'
networks:
drupal8:
external: false
services:
traefik:
container_name: ${DOMAIN}-traefik
image: traefik
@ronnycoding
ronnycoding / sign.js
Created August 26, 2018 16:31 — forked from variux/sign.js
const fs = require("fs");
const WebCrypto = require("node-webcrypto-ossl");
const xadesjs = require("xadesjs");
const { XMLSerializer } = require("xmldom-alpha");
const crypto = new WebCrypto();
xadesjs.Application.setEngine("OpenSSL", crypto);
function preparePem(pem) {
return pem
<?xml version="1.0" encoding="UTF-8"?>
<FacturaElectronica xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica">
<Clave>50609011800011717071900000000000000000034987656238</Clave>
<NumeroConsecutivo>00000000000000000032</NumeroConsecutivo>
<FechaEmision>2018-01-08T20:25:49.049Z</FechaEmision>
<Emisor>
<Nombre>Alvaro Andres Zuniga Hernandez</Nombre>
<Identificacion>
<Tipo>01</Tipo>
<Numero>117170719</Numero>
<?xml version="1.0" encoding="UTF-8"?>
<FacturaElectronica xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica">
<Clave>50609011800011717071900000000000000000034987656238</Clave>
<NumeroConsecutivo>00000000000000000032</NumeroConsecutivo>
<FechaEmision>2018-01-08T20:25:49.049Z</FechaEmision>
<Emisor>
<Nombre>Alvaro Andres Zuniga Hernandez</Nombre>
<Identificacion>
<Tipo>01</Tipo>
<Numero>117170719</Numero>
@ronnycoding
ronnycoding / Dockerfile
Created August 29, 2018 03:27 — forked from alkrauss48/Dockerfile
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app
@ronnycoding
ronnycoding / gist:dfd4d5e79fb77bf474e5c174124c9be2
Created August 30, 2018 01:40 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@ronnycoding
ronnycoding / GitHub curl.sh
Created August 30, 2018 02:22 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@ronnycoding
ronnycoding / docker-compose.yml
Created August 30, 2018 16:11 — forked from bossjones/docker-compose.yml
Elasticsearch and Kibana using docker-compose (v3)
# docker-compose build && docker-compose up -d
version: "3.2"
volumes:
elasticsearch_data:
driver: local
kibana_data:
driver: local
services:
@ronnycoding
ronnycoding / docker-compose.yml
Created September 2, 2018 15:46 — forked from eduwass/docker-compose.yml
Adding Mailhog to Docker-compose and enabling in WordPress
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@ronnycoding
ronnycoding / notes.md
Created September 10, 2018 16:36 — forked from monicao/notes.md
Setting up your own Ruby Dev Environment on a Mac

Setting up the Ruby dev environment on a Mac

Tested on Yosemite. Should work on El Cap. Message me if it doesn't.

Why would I want to do that?

  • You are tired of using vagrant
  • You want to run guard
  • You want use Sublime plugins (like RSpec or Guard plugins)
  • You want your code to run faster in development