Skip to content

Instantly share code, notes, and snippets.

Avatar

Josue Zarzosa josketres

  • @eSailors
  • Hamburg, Germany
View GitHub Profile
View gist:26e1d26d3bcf22dd4dca
Comparator<Person> compareByName = Comparator.comparing(Person p -> p.getName());
try (Stream<String> lines = Files.lines(Paths.get("text.txt"))) {
long count = lines
.flatMapToInt(String::codePoints)
.filter(c -> !Character.isSpaceChar(c))
.count();
System.out.printf("Count: %d", count);
} catch (Exception e) {
View keybase.md

Keybase proof

I hereby claim:

  • I am josketres on github.
  • I am josketres (https://keybase.io/josketres) on keybase.
  • I have a public key whose fingerprint is 5A1E 25E3 0E8E 0D1A 2ABE 23B8 C19D D50E 869B 4D63

To claim this, I am signing this object:

@josketres
josketres / install-git.sh
Created Jun 15, 2015
Install newest git on CentOS 6
View install-git.sh
# from https://www.digitalocean.com/community/tutorials/how-to-install-git-on-a-centos-6-4-vps
# added curl-devel - https://stackoverflow.com/questions/8329485/git-clone-fatal-unable-to-find-remote-helper-for-https/13018777#13018777
TMPDIR=/data/tmp
sudo yum install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel curl-devel
cd ~
wget -O git.zip https://github.com/git/git/archive/master.zip
unzip git.zip
rm git.zip
cd git-master
make configure
@josketres
josketres / bowerw
Last active Aug 29, 2015
Bower wrapper
View bowerw
#!/usr/bin/env bash
# Bower wrapper script for UN*X
# https://gist.github.com/josketres/f7a970e55a2e61533206
bower_bin=bower
command bower >/dev/null 2>&1 || {
bower_bin=$HOME/.bowerw/bin/bower
echo "Global bower not found, using $bower_bin";
command $bower_bin >/dev/null 2>&1 || {
@josketres
josketres / gruntw
Last active Aug 29, 2015
Grunt-cli wrapper
View gruntw
#!/usr/bin/env bash
# Grunt-cli wrapper script for UN*X
# https://gist.github.com/josketres/0e90b4e2b4a9e414708c
grunt_bin=grunt
grunt_check=" --version"
log_prefix="\e[95mgruntw\e[0m -"
command $grunt_bin $grunt_check >/dev/null 2>&1 || {
View gist:6934592
console.log('hello example');
ddd
@josketres
josketres / eclipse-favorite-types-java-tdd
Last active Jan 3, 2016
Useful favorite types to add to eclipse IDE for Java development (TDD)
View eclipse-favorite-types-java-tdd
# Useful favorite types to add to eclipse IDE for Java development (TDD)
# Add them in Eclipse under:
# Window -> Preferences -> Java -> Editor -> Content Assist -> Favorites -> New Type
org.hamcrest.MatcherAssert
org.hamcrest.Matchers
org.junit.Assert
org.testng.AssertJUnit
org.mockito.Mockito
org.mockito.MockitoAnnotations
View josketres.blogspot.com.css
@import url(https://fonts.googleapis.com/css?family=Merriweather:300);
@import url(https://fonts.googleapis.com/css?family=Raleway:400,500,700);
.post-body {
font-family: 'Merriweather', serif;
color: #151515;
font-size: 18px;
font-weight: 300;
line-height: 27px;
letter-spacing: -0.01em;
@josketres
josketres / Instrucciones.md
Last active Apr 11, 2016
unit-testing-exercise-java
View Instrucciones.md

#Ejercicio didáctico de pruebas unitarias de software# El programa acepta como entrada una cadena de caracteres, la salida es una lista de los caracteres que esten rodeados por guiones "-".

Por ejemplo: Entrada: aaa-bb-ccc Salida: [bb]

##Restricción arbitraria## Se restringe el uso de expresiones regulares. El programa Main.java debe de ser modificado de tal manera que no se haga uso de la clase java.util.regex.Pattern.