Skip to content

Instantly share code, notes, and snippets.

View wrpinheiro's full-sized avatar
😳
dazed and confused

Wellington Ricardo Pinheiro wrpinheiro

😳
dazed and confused
View GitHub Profile
@wrpinheiro
wrpinheiro / lexicographic-paths.clj
Created January 15, 2016 17:19
Solution for Hackerrank Lexicographic Paths
(defn factorial
([n] (factorial n 1))
([n total]
(if (= n 0)
total
(recur (dec n) (* n total)))))
(defn combination-with-repetition
"Calculates (h+v)! / (h! * v!)"
[h v]
@wrpinheiro
wrpinheiro / clojure-compendium.md
Last active April 3, 2016 16:10
Clojure Compendium
@wrpinheiro
wrpinheiro / accessible.sh
Last active August 29, 2015 14:22
Check if a port from a host is accessible
curl --connect-timeout 1 www.google.com.br:81 > /dev/null 2>&1; echo $?
@wrpinheiro
wrpinheiro / gist:e2571ebfbfc1f8e08f24
Created August 21, 2014 02:07
Ruby include & extend
# Version 1
# Some basic include & extend approach
module AnyModule
def an_instance_method
end
module ClassMethods
def a_class_method
end
end
@wrpinheiro
wrpinheiro / gist:90024046c4d60a4d7f84
Created August 20, 2014 19:22
Change ownership from all files
sudo chown --from=<current_owner> <new_owner> -R *
Wellington Pinheiro é mestre em Ciência da Computação pelo IME/USP na área de Inteligência Artificial e trabalha com desenvolvimento de sistemas desde 1997, utilizando Java e JEE na maior parte do tempo. Foi instrutor de Java na YAW, empresa parceira da Globalcode, e instrutor da disciplina de Arquitetura de Software no curso de SOA da pós graduação do IBTA por 3 anos. Atualmente está trabalhano com Ruby on Rails no e-commerce do Walmart.
@wrpinheiro
wrpinheiro / settings.xml
Created May 17, 2013 18:58
Maven settings.xml file to integrate with Artifactory
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- The following configuration is used to authenticate with -->
<!-- Artifactory if we need to deploy a file to the repository -->
@wrpinheiro
wrpinheiro / pom.xml
Last active December 17, 2015 11:19
Maven pom settings to integrate with Artifactory
<distributionManagement>
<repository>
<id>artifactory</id>
<name>artifactory-releases</name>
<url>http://localhost:8081/artifactory/libs-release-local</url>
</repository>
</distributionManagement>
@wrpinheiro
wrpinheiro / cretate-mvn-project.sh
Created May 8, 2013 17:39
Criando um projeto vazio do Maven com uma única linha
mvn archetype:generate -B -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=<groupId> -DartifactId=<artifactId> -DpacakgeName=<packageName> -Dversion=1.0