Skip to content

Instantly share code, notes, and snippets.

View vromero's full-sized avatar

Victor Romero vromero

View GitHub Profile
You accept and agree to the following terms and conditions for Your
present and future Contributions submitted to Victor Romero. In
return, Victor Romero shall not use Your Contributions in a way that
is contrary to the public benefit or inconsistent with its nonprofit
status and bylaws in effect at the time of the Contribution. Except
for the license granted herein to Victor Romero and recipients of
software distributed by Victor Romero, You reserve all right, title,
and interest in and to Your Contributions.
@vromero
vromero / foaf.rdf
Created April 7, 2018 16:33
My foaf
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:admin="http://webns.net/mvcb/">
<foaf:PersonalProfileDocument rdf:about="">
<foaf:maker rdf:resource="#me"/>
<foaf:primaryTopic rdf:resource="#me"/>
<admin:generatorAgent rdf:resource="http://www.ldodds.com/foaf/foaf-a-matic"/>
<admin:errorReportsTo rdf:resource="mailto:[email protected]"/>
@vromero
vromero / installer.sh
Last active April 4, 2018 18:30
AMF CLI installer
#!/usr/bin/env bash
# Copyright 2018 MuleSoft All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@vromero
vromero / Main.java
Last active November 28, 2016 08:15
Traverse matrix in spiral form. My personal approach.
package com.company;
public class Main {
/**
* This algorithm will divide the matrix into layers and portions. Layers are taken from the outside to the inside.
* i.e:
* <pre>
* 1 1 1 1 1
* 1 2 2 2 1
@vromero
vromero / gist:dd6cfdc2a226a8589ef0
Created July 28, 2014 05:48
Convert MuleSoft documentation to asciidoc
#!/bin/bash
#===================================================================================
#
# FILE: mule-docs-to-asciidoc.sh
#
# USAGE: mule-docs-to-asciidoc.sh
#
# DESCRIPTION: List and/or delete all stale links in directory trees.
# The default starting directory is the current directory.
# Don’t descend directories on other filesystems.
@vromero
vromero / gist:10383983
Created April 10, 2014 13:46
Mutual Auth Cert generator
###### Configuration block
DAYS=3650
SERVER_PRIVATE_KEY_FILENAME="server-private.pem"
CLIENT_PRIVATE_KEY_FILENAME="client-private.pem"
SERVER_CERTIFICATE_FILENAME="server-certificate.pem"
CLIENT_CERTIFICATE_FILENAME="client-certificate.pem"
@vromero
vromero / gist:10073890
Created April 7, 2014 23:39
Validate Local Maven Repository
COLOR_RED=$'\e[0;31m'; COLOR_GREEN=$'\e[0;32m'; COLOR_END=$'\e[0m'; for FILE in $(find ~/.m2/repository -name "*.sha1") ; do CALCULATED_DIGEST=$(openssl dgst -sha1 -binary ${FILE%.*}| xxd -p); DIGEST=$(for i in $(for i in $(cat ${FILE});do if [[ $i =~ ^.{40}$ ]] ; then echo $i; fi ; done);do echo $i; done ); ISVALID=$([ $CALCULATED_DIGEST == $DIGEST ] && echo ${COLOR_GREEN}VALID${COLOR_END} || echo ${COLOR_RED}INVALID${COLOR_END}); echo ${ISVALID} ${FILE%.*} ${DIGEST} ${CALCULATED_DIGEST}; done