Skip to content

Instantly share code, notes, and snippets.

View vinnyvoffice's full-sized avatar

Vinícius Rodrigues Nunes vinnyvoffice

View GitHub Profile
@vinnyvoffice
vinnyvoffice / DevDataSourceCondition.java
Last active May 21, 2018 23:41
Learning by doing: @org.springframework.context.annotation.Conditional
package com.guiajava.learning.org.springframework.context.annotation.condition.samples.sample1;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
public class DevDataSourceCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
@vinnyvoffice
vinnyvoffice / curl.md
Created May 5, 2018 19:34 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

[Thor](https://image.tmdb.org/t/p/w1280/bIuOWTtyFPjsFDevqvF3QrD1aun.jpg)
  • C001 - Create repository on Github (version control)
  • C002 - Create Maven project (build tool)
  • C003 - Create Eclipse project (development tool)
  • C004 - Install Tomcat (servlet container)
  • C005 - Deploy application at Heroku
  • C010 - List all movies
  • C020 - Create a movie
  • C030 - Remove a movie
  • C040 - Update a movie
  • C050 - Find movies by field
@vinnyvoffice
vinnyvoffice / Currying.java
Created December 31, 2017 17:02 — forked from timyates/Currying.java
Currying and composition in Java 8
package java8tests ;
import java.util.function.BiFunction ;
import java.util.function.Function ;
public class Currying {
public void currying() {
// Create a function that adds 2 integers
BiFunction<Integer,Integer,Integer> adder = ( a, b ) -> a + b ;
@vinnyvoffice
vinnyvoffice / GsonHelper.java
Created December 17, 2017 22:04 — forked from orip/GsonHelper.java
Gson type adapter to serialize and deserialize byte arrays in base64
import java.lang.reflect.Type;
import android.util.Base64;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
@vinnyvoffice
vinnyvoffice / README
Created November 24, 2017 21:36 — forked from evelyne24/README
I've been using Maven for Android projects quite extensively from command line lately and I found that a colour output is really helpful.I'm using iTerm2 on MacOs Mavericks (10.9). I've found a couple of bash scripts to colorise Maven output but none was quite enough for me :PThe two best I found are https://gist.github.com/mike-ensor/1881211 and
The blog post explainig how to use this: http://android.codeandmagic.org/colorize-maven-output/
source $HOME/.mvn_colour.sh
@vinnyvoffice
vinnyvoffice / clone and install github maven projects
Created November 24, 2017 21:31 — forked from pulse00/clone and install github maven projects
Shell script to clone and build (maven) github projects. Put a `projects.txt` file into the script folder containing.
#!/bin/sh
###########################
## Shell script to clone a list of github repositories and run `mvn clean install` on each one of them
##
## Usage: put a file called `repos.txt` in the folder of the script containing the repository URLs, line by line:
##
##https://github.com/pulse00/Composer-Eclipse-Plugin.git
##git@github.com:pulse00/Symfony-2-Eclipse-Plugin.git
##etc
@vinnyvoffice
vinnyvoffice / _notes.md
Created November 12, 2017 12:29 — forked from sgnl/_notes.md
AJAX with Vanilla Javascript. (XMLHttpRequest)

Short XHR Examples

Examples shown are bare minimum needed to achieve a simple goal.

Resources

  • Google Chrome's Dev Tools' Network Panel c-c-c-c-c-ULTIMATE c-c-c-COMBO!!!
  • requestb.in enpoints for your HTTP Requests as a free service.