Skip to content

Instantly share code, notes, and snippets.

View jamilsonjunior's full-sized avatar

Jamilson Junior jamilsonjunior

  • Paranavaí, PR - Brasil
View GitHub Profile
@jamilsonjunior
jamilsonjunior / GenericDAO.java
Last active January 2, 2018 22:25
Por quê não consigo apagar um objeto com o Hibernate?
package dao;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.Query;
@jamilsonjunior
jamilsonjunior / gist:5f1f0990d08f3b0c0939d0c658b7c247
Created December 20, 2017 01:04
Facebook Messenger Chat Extension
<script>
window.fbMessengerPlugins = window.fbMessengerPlugins || {
init: function () {
FB.init({
appId : 'xxxxxxxxxxx',
autoLogAppEvents : true,
xfbml : true,
version : 'v2.10'
});
}, callable: []
public JSONArray getJsonArray(String url) {
JSONArray jObj = null;
try {
String line, newjson = "";
URL urls = new URL(url);
BufferedReader reader = new BufferedReader(new
InputStreamReader(urls.openStream(), "UTF-8"));
while ((line = reader.readLine()) != null) {
newjson += line;
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jamilsonjunior</groupId>
<artifactId>HelloWorld</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<repositories>
<repository>
<id>prime-repo</id>