This file contains hidden or 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
| public class MultipartRequest extends Request<String> { | |
| private MultipartEntity entity = new MultipartEntity(); | |
| private static final String FILE_PART_NAME = "file"; | |
| private static final String STRING_PART_NAME = "text"; | |
| private final Response.Listener<String> mListener; | |
| private final File mFilePart; | |
| private final String mStringPart; |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| INPUT=$1 | |
| # INPUT="/Users/kamola_greg/dev/identity/AUSTRALIAN_PASSPORT.jpg" | |
| if [ -z ${INPUT+x} ] | |
| then | |
| echo "Usage: $0 <INPUT_IMAGE>" | |
| exit |
This file contains hidden or 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
| @Override | |
| public void onRun() { | |
| ExecutorService consumers = Executors.newFixedThreadPool(concurrentJobs); | |
| List<TransferTask> transferTasks = findPointLineItemsAwaitingTransfer().stream() | |
| .map(pointLineItem -> new TransferTask(pointLineItem, lslCircuitBreaker)) | |
| .collect(Collectors.toList()); | |
| try { | |
| for (Future<Void> task: consumers.invokeAll(transferTasks)) { |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # | |
| # Usage: | |
| # | |
| # cat avro-application.log | grep "Authentication details updated\|Received notification for data update" | awk '$0 ~ /Authentication/ { print $(NF-8), $(NF-4) }; $0 ~ /notification/ { print $NF }' | ./fitbit_repair.sh | |
| # | |
| # Example output: | |
| # | |
| # -- Public member id: 8a04888a5316f3db01533b5eb5685047, access token: eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NTcwNTY1NjcsInNjb3BlcyI6InJhY3QiLCJzdWIiOiIyOTZLNEIiLCJhdWQiOiIyMjdHNlQiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJpYXQiOjE0NTcwNTI5Njd9.8fdxt6GL9J4YbNbXM_BvWj_FXJ-Li4UsDy54hQwxnkI, refresh token: 5b35163b40c25ef16af66d66a4f2ce1bc30982ede17e88dbfdeddb89e824bab8 |
This file contains hidden or 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 javax.inject.Inject | |
| import play.api.http._ | |
| import play.api.mvc.RequestHeader | |
| import play.api.routing.Router | |
| import play.core.j.JavaHandlerComponents | |
| class VersionAwareRequestHandler @Inject() (errorHandler: HttpErrorHandler, | |
| configuration: HttpConfiguration, filters: HttpFilters, components: JavaHandlerComponents, | |
| routes: service.Routes | |
| ) extends JavaCompatibleHttpRequestHandler(routes, errorHandler, configuration, filters, |
This file contains hidden or 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
| public class SkiResortsEasy { | |
| public int minCost(int[] altitude) { | |
| int cost = 0; | |
| for (int i = 1; i < altitude.length; i++) { | |
| int diff = altitude[i] - altitude[i-1]; | |
| if (diff > 0) { | |
| cost += diff; | |
| altitude[i] = altitude[i-1]; | |
| } |