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 | |
if [ "$#" -ne 2 ] | |
then | |
echo "Add a subdomain redirection to nginx." | |
echo "Usage: <subdomain> <port>" | |
exit 1 | |
fi | |
echo "Redirecting the subdomain '$1' to local port '$2'." |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sys import stdin | |
if __name__ == '__main__': | |
i = 1 | |
for line in stdin: | |
if not line.strip(): | |
print() | |
i = 1 | |
continue |
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 torch | |
import numpy as np | |
import torch.nn as nn | |
import itertools | |
corpus = [ | |
("this is a very good sentence number one".split(), [1.0, 0.0]), | |
("a rather bad example".split(), [0.0, 1.0]), | |
("an even better sentence to use".split(), [1.0, 0.0]), | |
("negative sentence very short".split(), [0.0, 1.0]) |
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 os | |
from typing import Dict, List, Optional | |
import requests | |
from jose import jwt, jwk | |
from jose.utils import base64url_decode | |
JWK = Dict[str, str] | |
JWKS = Dict[str, List[JWK]] |
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 boto3 | |
import json | |
client = boto3.client('events') | |
rule = client.put_rule( | |
Name="MyRuleId", | |
ScheduleExpression="rate(2 minutes)", | |
State="ENABLED" | |
) |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "lambda.amazonaws.com" | |
}, | |
"Action": "sts:AssumeRole" | |
}, |
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
rule = client.put_rule( | |
Name="MyRuleId", | |
ScheduleExpression="rate(2 minutes)", | |
State="ENABLED", | |
RoleArn="MyRoleARN" | |
) |
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
lambda_client = boto3.client('lambda') | |
lambda_client.add_permission( | |
FunctionName="MyLambdaFunctionARN", | |
StatementId="IUseTheSameHereAsTheRuleIdButYouDoAsYouPlease", | |
Action="lambda:InvokeFunction", | |
Principal="events.amazonaws.com", | |
SourceArn=rule["RuleArn"] | |
) |
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 boto3 | |
import json | |
client = boto3.client('events') | |
lambda_client = boto3.client('lambda') | |
def add_schedule(): | |
rule = client.put_rule( | |
Name="MyRuleId", | |
ScheduleExpression="rate(2 minutes)", |
OlderNewer