View main.go
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
package main | |
import ( | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/lambda" | |
"github.com/aws/aws-sdk-go/service/sts" | |
) | |
func main() { |
View tokenizer.py
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
from enum import Enum | |
from functools import wraps | |
def assert_simgle_char(f): | |
@wraps(f) | |
def inner(c: str): | |
if len(c) != 1: | |
raise ValueError(c) | |
return f(c) |
View main.go
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
typeSwitch := func(v interface{}) { | |
switch v.(type) { |
View main.go
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"sort" | |
) | |
type Person struct { |
View main.rs
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
use std::fmt; | |
struct Circle { | |
radius: u32 | |
} | |
impl Circle { | |
fn diameter(&self) -> u32 { | |
self.radius * 2 | |
} |
View handler.py
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 json | |
import gzip | |
import logging | |
from base64 import b64decode | |
log = logging.getLogger(__name__) | |
def handler(event, context): |
View serverless.yml
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
resources: | |
Resouces: | |
SmSubscription: | |
Type: AWS::Logs::SubscriptionFilter | |
Properties: | |
LogGroupName: !Ref StateMachineLogGroup | |
FilterPattern: ExecutionFailed | |
DestinationArn: !GetAtt [JobFailureEventStream, Arn] | |
RoleArn: !GetAtt [KinesisSubscriptionRole, Arn] | |
JobFailureEventStream: |
View send-get-request-to-opensearch-using-curl-with-sigv4.sh
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
aws_region='ap-northeast-1' | |
endpoint="https://DOMAIN_NAME.${aws_region}.es.amazonaws.com/" | |
AWS_ACCESS_KEY_ID='foo' | |
AWS_SECRET_ACCESS_KEY='bar' | |
curl $endpoint --verbose --aws-sigv4 "aws:amz:${aws_region}:es" --user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}" |
View vimrc
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
syntax on | |
set ts=4 | |
set sm | |
set number | |
inoremap <silent> jj <ESC> |
View main.go
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
package main | |
import ( | |
"log" | |
"net/http" | |
"sync" | |
"text/template" | |
"path/filepath" | |
) |
NewerOlder