Skip to content

Instantly share code, notes, and snippets.

Avatar

Jony Santos jonyfs

View GitHub Profile
@rponte
rponte / AcessaWsDaSefaz.java
Created Aug 20, 2014
Acessando WS da Sefaz para NF-e
View AcessaWsDaSefaz.java
package br.com.syspdv.nfe.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.net.URL;
import java.security.Security;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPConnection;
@wdullaer
wdullaer / install.sh
Last active Sep 27, 2021
Install Latest Docker and Docker-compose on Ubuntu
View install.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@ggtools
ggtools / TestMongoConfig.java
Created Oct 7, 2014
A Spring configuration to use an embedded MongoDB during tests
View TestMongoConfig.java
@Configuration
public class TestMongoConfig {
private static final MongodStarter starter = MongodStarter.getDefaultInstance();
@SuppressWarnings("SpringJavaAutowiringInspection")
@Autowired
private MongoProperties properties;
@Autowired(required = false)
private MongoClientOptions options;
@carlcantprogram
carlcantprogram / gist:42fbecb399af7e8ce4c0
Last active Jun 29, 2018
Oracle JDK7 Download Install powershell
View gist:42fbecb399af7e8ce4c0
$url = 'http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-windows-x64.exe'
$filename = $url.Substring($url.LastIndexOf("/") + 1);
$client = new-object System.Net.WebClient;
$client.Headers.Add("Cookie", "oraclelicense=accept-securebackup-cookie");
$client.DownloadFile( $url, $filename );
$result = (Start-Process -FilePath $filename -ArgumentList "/quiet /qn /norestart /l* jdk7_install.log" -Wait -Passthru).ExitCode;
echo $result;
Get-WmiObject -Class Win32_Product -Filter "Name LIKE '%java%SE Development Kit 7%'";
# IdentifyingNumber : {64A3A4F4-B792-11D6-A78A-00B0D0170600}
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active Sep 20, 2021
jenkins groovy scripts collection.
View _Jenkins+Script+Console.md
View gist:4df7e2257d7e10c50a30
Obs: http://tinyurl.com/raml-file
-----
#%RAML 0.8
baseUri: http://mocksvc.mulesoft.com/mocks/a296cd19-32ae-4c10-ba8a-ffb527bd4f24
title: pagamentos
version: 1.0
mediaType: application/json
@bcalmac
bcalmac / CaseInsensitiveSetMultimap.java
Created Mar 10, 2015
Case insensitive SetMultimap using Guava
View CaseInsensitiveSetMultimap.java
import com.google.common.collect.ForwardingSetMultimap;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
/** SetMultimap decorator that coverts keys to lower case before delegation */
public class CaseInsensitiveSetMultimap<V> extends ForwardingSetMultimap<String, V> {
@gilyes
gilyes / Backup, restore postgres in docker container
Last active Aug 25, 2021
Backup/restore postgres in docker container
View Backup, restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@facundofarias
facundofarias / WebSocketResource.java
Last active Jan 28, 2019
Enabling WebSockets on Jersey (Tyrus)
View WebSocketResource.java
import java.io.IOException;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import org.slf4j.Logger;
@rambabusaravanan
rambabusaravanan / .gitconfig
Last active Oct 11, 2021
Git Diff and Merge Tool - IntelliJ IDEA
View .gitconfig
# Linux
# add the following to "~/.gitconfig" file
[merge]
tool = intellij
[mergetool "intellij"]
cmd = /usr/local/bin/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]