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 json | |
import boto3 | |
settings = { | |
"aws.cloudsearch.doc": | |
"<doc-ep>", | |
"aws.cloudsearch.search": | |
"<search-ep>" | |
} | |
from avail.aws.cloudsearch import get_cloudsearch_endpoint_from_settings | |
doc = get_cloudsearch_endpoint_from_settings("doc", settings) |
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 json | |
import boto3 | |
region = "us-east-1" | |
settings = { | |
"bucket_name": "proj-notify-test123", | |
"queue_name": "proj-notify-test123", | |
"region": region, | |
"account_number": ACCOUNT_NUMBER |
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 boto3 | |
from boto3.dynamodb.types import STRING | |
table = boto3.resource("dynamodb", region_name="us-east-1").Table("availdev-JobStateDB-1UIJ881212TPX") | |
## Attrs for GSI | |
attrdef = [ | |
{"AttributeName": "state", "AttributeType": STRING}, | |
{"AttributeName": "userId", "AttributeType": STRING}, | |
{"AttributeName": "assetId", "AttributeType": STRING} |
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
package main | |
import ( | |
"encoding/base64" | |
"flag" | |
"io" | |
"log" | |
"net/http" | |
"strings" | |
) |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
ticker := time.Tick(time.Second) | |
for i := 1; i <= 10; i++ { |
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 mimetypes | |
for i in range(10): | |
print(mimetypes.guess_extension("image/tiff")) | |
print(mimetypes.guess_extension("image/jpeg")) | |
for i in range(10): | |
mimetypes.init() | |
print(mimetypes.guess_extension("image/jpeg")) |
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
# This is a copy of the clang-format vim-integration script, refactored to work | |
# with yapf. | |
# Questions and/or suggestions? I'm @pignacio in github. | |
# This script is hosted at http://gist.github.com/pignacio/f93218bbafa2aa94610c | |
# I'm not sure if this works properly in windows/mac. Only tested in linux. | |
# | |
# This file is a minimal yapf vim-integration. To install: | |
# - Change 'binary' if yapf is not on the path (see below). | |
# - Add to your .vimrc: | |
# |
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
// Copyright 2015 Google Inc. All Rights Reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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/python3 | |
# By Steve Hanov, 2011. Released to the public domain. | |
# Updated 2014 to use DAWG as a mapping. | |
import sys | |
import time | |
DICTIONARY = "/usr/share/dict/words" | |
QUERY = sys.argv[1:] | |
# This class represents a node in the directed acyclic word graph (DAWG). It |
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
package main | |
import ( | |
"container/heap" | |
"fmt" | |
) | |
type KVPair struct { | |
Key string | |
Value interface{} |