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
version: '3.6' | |
services: | |
# MySQL | |
db: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: root |
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
CREATE DATABASE IF NOT EXISTS `test`; | |
GRANT ALL ON `test`.* TO 'user'@'%'; |
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
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf /Applications/Xcode.app | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode | |
rm -rf ~/Library/Developer | |
rm -rf ~/Library/MobileDevice | |
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist |
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
public static int solution(String s) { | |
char[] val = s.toCharArray(); | |
int sum = 0; | |
while(val[sum]=='0') { | |
sum++; | |
} | |
int reduce = 0; | |
for(int k=val.length-1; k>=sum; k--){ | |
if(val[k] =='1'){ | |
reduce+=2; |
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
{ | |
"name": "aurora-cdk", | |
"version": "0.1.0", | |
"bin": { | |
"aurora-cdk": "bin/aurora-cdk.js" | |
}, | |
"scripts": { | |
"build": "tsc", | |
"watch": "tsc -w", | |
"test": "jest", |
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
#!/usr/bin/env node | |
import 'source-map-support/register'; | |
import cdk = require('@aws-cdk/core'); | |
import { Aws, Construct } from '@aws-cdk/core'; | |
import { AuroraSlsStack } from '../lib/aurora-cdk-stack'; | |
const deploymentStage = 'aurora-sls-dev'; | |
const defaultEnv: cdk.Environment = { | |
account: Aws.ACCOUNT_ID, |
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
import { CfnOutput, Construct, Stack, StackProps } from '@aws-cdk/core'; | |
import { Vpc, SubnetType } from '@aws-cdk/aws-ec2'; | |
import { CfnDBCluster, CfnDBSubnetGroup } from '@aws-cdk/aws-rds'; | |
export class AuroraSlsStack extends Stack { | |
constructor(scope: Construct, id: string, props: StackProps, deploymentStage: string) { | |
super(scope, id, props); | |
// create vpc | |
const vpc = new Vpc(this, 'Vpc', { | |
cidr: '10.0.0.0/16', |
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
import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert'; | |
import * as cdk from '@aws-cdk/core'; | |
import * as AuroraCdk from '../lib/aurora-cdk-stack'; | |
test('Empty Stack', () => { | |
const app = new cdk.App(); | |
const deploymentStage = 'aurora-sls-dev'; | |
// WHEN | |
const stack = new AuroraCdk.AuroraSlsStack(app, 'AuroraSlsStack',{ env: { | |
region: process.env.region, |
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
class Solution { | |
public int solution(int[] ranks) { | |
// write your code in Java SE 8 | |
int sum = 0; | |
Set<Integer> soldierRank = new HashSet<Integer>(); | |
for (int i = 0; i< ranks.length; i++) { | |
soldierRank.add(ranks[i]); | |
} | |
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
class Solution { | |
public int solution(int[] ranks) { | |
// write your code in Java SE 8 | |
int sum = 0; | |
Set<Integer> soldierRank = new HashSet<Integer>(); | |
for (int i = 0; i< ranks.length; i++) { | |
soldierRank.add(ranks[i]); | |
} | |