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
CREATE EXTERNAL TABLE IF NOT EXISTS | |
cloudfront_logs.staging_partitioned ( | |
date DATE, | |
time STRING, | |
edge_location STRING, | |
response_bytes BIGINT, | |
ip STRING, | |
method STRING, | |
host STRING, | |
uri STRING, |
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
service: partition-cloudfront-logs | |
custom: | |
buckets: | |
staging: staging-bucket-name | |
production: production-bucket-name | |
BUCKET: ${self:custom.buckets.${self:provider.stage}} | |
athena_table: | |
staging: staging_partitioned | |
production: production_partitioned | |
ATHENA_TABLE: ${self:custom.athena_table.${self:provider.stage}} |
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
def lambda_handler(event, context, s3_client=None, | |
athena_client=None): | |
start_time = time.time() | |
records = event["Records"] | |
logger.info(f"Received event with {len(records)} records") | |
if s3_client is None: | |
s3_client = boto3.client("s3") | |
if athena_client is None: | |
athena_client = boto3.client("athena") | |
for record in records: |
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 {Context} from 'probot/lib/context'; | |
import {ChecksUpdateParamsOutput} from '@octokit/rest'; | |
import {WebhookPayloadPullRequest} from '@octokit/webhooks'; | |
import CheckRun, {ICheckRun} from './CheckRun'; | |
export default class SampleCheck extends CheckRun implements ICheckRun { | |
static checkName: string = 'my-cool-check'; | |
public payload: WebhookPayloadPullRequest; |
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 {ChecksUpdateResponse, ChecksUpdateParamsOutput, ChecksCreateResponse, Response, ReposCompareCommitsResponse} from '@octokit/rest'; | |
import {WebhookPayloadCheckRun, WebhookPayloadCheckSuite, WebhookPayloadPullRequest} from '@octokit/webhooks'; | |
import {GitHubAPI} from 'probot/lib/github'; | |
import {Context} from 'probot/lib/context'; | |
import {Logger} from 'probot/lib'; | |
export default class CheckRun { | |
public context: Context; | |
public github: GitHubAPI; |
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
checks: | |
- hydra/dependencies: | |
required: true | |
- hydra/owners: | |
required: true | |
- hydra/package.json: | |
required: true | |
- hydra/quarantine: | |
required: true | |
- hydra/dockerfile |
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 {ChecksUpdateResponse, ChecksUpdateParamsOutput, ChecksCreateResponse, Response, ReposCompareCommitsResponse} from '@octokit/rest'; | |
export interface ICheckRun { | |
start(): Promise<Response<ChecksCreateResponse> | false>; | |
run(compare: Response<ReposCompareCommitsResponse>): Promise<void>; | |
finish(success: boolean, output?: ChecksUpdateParamsOutput): Promise<Response<ChecksUpdateResponse>>; | |
} |
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 {Application} from 'probot'; | |
import {Context} from 'probot/lib/context'; | |
export = (app: Application) => { | |
app.on('pull_request', async (context: Context) => { | |
context.logger.info('Pull Request event', context.payload); | |
}); | |
app.on('check_suite.requested', async (context: Context) => { | |
await context.github.checks.create({ |
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
class ViewController: UIViewController { | |
private var onTap: (() -> Void)? | |
override func viewDidLoad() { | |
onTap = refreshTitle | |
} | |
private func refreshTitle() { | |
() = { [weak self] in | |
self?.title = "Refreshed" // ✅ Doesn't capture self strongly |
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
class ViewController: UIViewController { | |
private var onTap: (() -> Void)? | |
override func viewDidLoad() { | |
onTap = { [weak self] in | |
self?.refreshTitle() // ✅ Doesn't capture self strongly | |
} | |
} | |
private func refreshTitle() { |
NewerOlder