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
// See: https://www.youtube.com/watch?v=HaEPXoXVf2k | |
const AWS = require('aws-sdk'); | |
AWS.config.update({region: 'us-east-1'}); | |
const dynamoDb = new AWS.DynamoDB.DocumentClient({ api_version: '2012-08-10' }); | |
const TABLE = 'single-table-design'; | |
const GSI1 = 'gsi1'; | |
const GSI1PK = `${GSI1}pk`; | |
const GSI1SK = `${GSI1}sk`; |
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 numpy as np | |
# print(np.__version__) | |
ROW_COUNT = 6 | |
COLUMN_COUNT = 7 | |
WINNG_PIECE_COUNT = 4 | |
def create_board(): | |
board = np.zeros((ROW_COUNT, COLUMN_COUNT)) | |
return board |
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: AWSAppSync DynamoDB Example | |
Resources: | |
GraphQLApi: | |
Type: "AWS::AppSync::GraphQLApi" | |
Properties: | |
Name: AWSAppSync DynamoDB Example | |
AuthenticationType: AWS_IAM | |
PostDynamoDBTableDataSource: |
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
sudo: required #is required to use docker service in travis | |
language: php #can be any language, just php for example | |
services: | |
- docker # required, but travis uses older version of docker :( | |
install: | |
- echo "install nothing!" # put your normal pre-testing installs here |
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/bash | |
#### Description: Assumes an AWS IAM role and export temporary AWS_* credentials. | |
#### Written by: Nick den Engelsman - nick@bandlab.com on 2017-05 | |
#### | |
#### Setup: | |
#### 1. npm install -g aws-auth-helper | |
#### 2. save this script as ~/.aws/mfa.sh | |
#### 3. chmod +x ~/.aws/mfa.sh | |
#### | |
#### Edit your .bash_rc (or something else): |
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
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The | |
# XML Reader is a good way to move a cursor through a (large) XML document fast, | |
# but is not as cumbersome as writing a full SAX document handler. Read about | |
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html | |
# | |
# Just pass the reader in this parser and specificy the nodes that you are interested | |
# in in a block. You can just parse every node or only look inside certain nodes. | |
# | |
# A small example: | |
# |
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
#!/usr/bin/env ruby | |
# == Simple Daemon | |
# | |
# A simple ruby daemon that you copy and change as needed. | |
# | |
# === How does it work? | |
# | |
# All this program does is fork the current process (creates a copy of | |
# itself) then exits, the fork (child process) then goes on to run your | |
# daemon code. In this example we are just running a while loop with a |