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.*; | |
import java.util.stream.*; | |
class Scratchpad { | |
// There is a dictionary containing words from an alien language for which we don’t know the ordering of the alphabets. | |
// Write a method to find the correct order of the alphabets in the alien language. It is given that the input is a valid dictionary and there exists an ordering among its alphabets. | |
// Example 1: | |
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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode() {} | |
* ListNode(int val) { this.val = val; } | |
* ListNode(int val, ListNode next) { this.val = val; this.next = next; } | |
* } | |
*/ |
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
/** | |
* Definition for singly-linked list. | |
* class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { | |
* val = x; | |
* next = null; | |
* } | |
* } |
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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode() {} | |
* ListNode(int val) { this.val = val; } | |
* ListNode(int val, ListNode next) { this.val = val; this.next = next; } | |
* } | |
*/ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> <dict> | |
<key>UserDefinedName</key> | |
<string>AbhiNita VPN profile</string> | |
<key>PayloadDisplayName</key> | |
<string>AbhiNita VPN profile</string> |
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
public Response handleRequest(Map<String, Object> request, Context context) { | |
LOG.info("My lambda has started with request {}", request); | |
throw new RuntimeException("Failed: Something bad happened"); | |
} |
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
@Slf4j | |
public class Invalidate { | |
private static final String CLOUD_FRONT_DISTRIBUTION_ID = System.getenv("distribution_id"); | |
private static final AmazonCloudFront AMAZON_CLOUD_FRONT_CLIENT | |
= AmazonCloudFrontClient.builder().withCredentials(new EnvironmentVariableCredentialsProvider()) | |
.withRegion(Regions.US_WEST_2).build(); | |
public void invalidateListOfItems(final List<String> itemsToInvalidate) { |
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
@Slf4j | |
public class LambdaHandler implements RequestHandler<S3EventNotification, Response> { | |
private Invalidate invalidate = new Invalidate(); | |
public Response handleRequest(S3EventNotification request, Context context) { | |
final List<S3EventNotificationRecord> records = request.getRecords(); | |
final List<String> objectIdsToInvalidate = Lists.newArrayList(); |
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
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }} | |
{{if lt (len $paginator.Pages) 1}} | |
<h1>All Tags</h1> | |
{{ range $.Site.Taxonomies.tags.ByCount }} | |
<span> | |
<a href="/tags/{{ .Name }}"> {{ .Name }} <small>({{ .Count }})</small></a> | |
</span> | |
<span> </span> | |
{{end}} | |
{{end}} |
NewerOlder