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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: "CloudFormation Stack with Lambda and IAM Role" | |
Resources: | |
MyLambdaRole: | |
Type: "AWS::IAM::Role" | |
Properties: | |
RoleName: "MyLambdaExecutionRole" | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" |
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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: "CloudFormation Stack with S3 and DynamoDB" | |
Resources: | |
MyS3Bucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
BucketName: !Sub "my-app-bucket-${AWS::AccountId}" | |
MyDynamoDBTable: |
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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: "Example CloudFormation stack with rollback triggers using CloudWatch alarms" | |
Resources: | |
MyS3Bucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
BucketName: !Sub "my-cloudformation-bucket-${AWS::AccountId}" | |
MyAlarm: |
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 ( | |
"crypto/hmac" | |
"crypto/rand" | |
"crypto/sha1" | |
"fmt" | |
"math/big" | |
) |
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 ( | |
"crypto/hmac" | |
"crypto/sha256" | |
"fmt" | |
) | |
func main() { | |
fmt.Println("Example CLWW 2016 Implementation") |
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 ( | |
"sync" | |
"testing" | |
) | |
type stuff struct { | |
ret chan string | |
input 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 ( | |
"errors" | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func init() { |
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 ( | |
"errors" | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func init() { |
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
#include <stdio.h> | |
int main() { | |
// Given an unsigned char, if we add 1 to the max value an unsigned char can have, | |
// we strangely get the correct value, which should have overflown the char... | |
unsigned char a = 255; | |
printf("%lu + 1 == %d \n", a, a + 1); | |
// Output: 255 + 1 == 256 | |
// When we take this value and assign it to an unsigned char, and look at the |
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
#include <stdio.h> | |
int main() { | |
// Down Casting an unsigned long to an unsigned char | |
unsigned long a = 257; | |
printf("%lu == %d \n", a, (unsigned char)a); | |
// Output: 257 == 1 | |
// This is obviously not true, but there are not enough bits in a | |
// char (8 bits) to hold 257, so it will carry over the extra into the value |
NewerOlder