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 java.io.BufferedReader | |
import java.io.File | |
import java.io.InputStream | |
import java.io.InputStreamReader | |
import java.util.* | |
import java.util.function.Function | |
import java.util.function.BiConsumer | |
import java.util.function.BinaryOperator | |
import java.util.function.Supplier | |
import java.util.stream.Collector |
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
// Compute sum of salaries by department | |
Map<Intenger, Integer> totalByBucket = nums.stream() | |
.collect(Collectors.groupingBy(::getBucket, Collectors.summingInt(i))); |
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 java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class Example { | |
public static void main(String[] args) { | |
List<Integer> test = Arrays.asList(1,2,3,4,5,6,7,8,9,10); | |
System.out.println(businessLogic(test)); | |
System.out.println(businessLogicFunctional(test)); |
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
what is git? | |
what is an api? | |
what is a web server? | |
what is a compiler? |
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
""" | |
=========== | |
Description | |
=========== | |
Simple script to copy and gzip static web files to an AWS S3 bucket. S3 is great for cheap hosting of static web content, but by default it does not gzip CSS and JavaScript, which results in much larger data transfer and longer load times for many applications | |
When using this script CSS and JavaScript files are gzipped in transition, and appropriate headers set as per the technique described here: http://www.jamiebegin.com/serving-compressed-gzipped-static-files-from-amazon-s3-or-cloudfront/ | |
* Files overwrite old versions |