This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script> | |
</head> | |
<body> | |
<script> | |
$(document).ready(function() { | |
var url = "https://twitter.com/intent/tweet?" + $.param({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
window._gaq = window._gaq || []; | |
var ga = wav.ga; | |
var eventsPercentage = wav.$config.data("ga-events-percentage"); | |
ga.getCurrentPageCategory = function() { | |
return "page_" + wav.getCurrentPage(); | |
}; | |
ga.isLoaded = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
processName="vs-site" | |
logsPath="/home/fbelov" | |
delay=15 | |
logsFullPath=${logsPath}/${processName}-jstack | |
mkdir -p $logsFullPath | |
while true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonValue; | |
public enum ExceptionStatus { | |
OPENED("open"), FIXED("fixed"), IGNORE("ignore"), LATER("later"); | |
private String id; | |
ExceptionStatus(String id) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Client client = ClientBuilder.newBuilder() | |
.register(MultiPartFeature.class) | |
.build(); | |
WebTarget target = client.target(config.getFilePath(id)); | |
StreamDataBodyPart filePart = new StreamDataBodyPart("file", new FileInputStream(archiveFiles(files)), "a.zip"); | |
MultiPart multipart = new FormDataMultiPart().bodyPart(filePart); | |
response = target.request(MediaType.APPLICATION_JSON_TYPE).post(Entity.entity(multipart, multipart.getMediaType())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JacksonJsonProvider jacksonJsonProvider = new JacksonJaxbJsonProvider(); | |
ObjectMapper objectMapper = new ObjectMapper() | |
.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES) | |
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) | |
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); | |
jacksonJsonProvider.setMapper(objectMapper); | |
client = ClientBuilder.newClient().register(jacksonJsonProvider); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JsonDeserialize(converter=MyClassSanitizer.class) // invoked after class is fully deserialized | |
public class MyClass { | |
public String field1; | |
} | |
import com.fasterxml.jackson.databind.util.StdConverter; | |
public class MyClassSanitizer extends StdConverter<MyClass,MyClass> { | |
@Override | |
public MyClass convert(MyClass var1) { | |
var.field1 = munge(var.field1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require("gulp"); | |
var del = require("del"); | |
var path = require("path"); | |
var lazypipe = require("lazypipe"); | |
var $ = require("gulp-load-plugins")({lazy: false}); | |
var paths = { | |
src: "./src", | |
assets: { | |
src: "./assets", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return dvds | |
.request() | |
.accept(MediaType.APPLICATION_JSON) | |
.get(new GenericType<List<ConsumedDvd>>(){}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.devadmin.util.metrics | |
import org.springframework.context.annotation.Configuration | |
import org.springframework.context.annotation.ImportResource | |
import org.springframework.test.context.ContextConfiguration | |
import org.springframework.test.context.transaction.TransactionConfiguration | |
import org.springframework.transaction.annotation.Transactional | |
import spock.lang.Specification | |
@Configuration |
OlderNewer