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 time | |
import boto3 | |
# docs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html | |
client = boto3.client('logs') | |
def get_current_timestamp(): | |
return int(time.time() * 1000) | |
def lambda_handler(event, context): |
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 Solution { | |
public: | |
vector<int> findAnagrams(string s, string p) { | |
vector<int> result; | |
unordered_map<char, int> charToFreqP; | |
unordered_map<char, int> charToFreqS; | |
int k = p.size(); | |
for (char c = 'a'; c <= 'z'; c++) { | |
charToFreqS[c] = 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
class Solution { | |
public: | |
int maxVowels(string s, int k) const { | |
int local_max = 0; | |
int global_max = 0; | |
for (int i = 0; i < k; i++) { | |
if (isVowel(s, i)) local_max++; | |
global_max = max(local_max, global_max); |
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
#!/usr/bin/env bash | |
set -e | |
# updating system | |
yum update -y | |
# installing docker | |
yum install docker -y |
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 Node { | |
constructor(value, next) { | |
this.value = value; | |
this.next = next; | |
} | |
} | |
class Stack { | |
constructor() { | |
this.firstNode = null; |
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
function longestPrefix(words) { | |
if (words.length == 0) return `""`; | |
const longestPossiblePrefixSize = Math.min(...words.map(word => word.length)) | |
for (let prefixSize = longestPossiblePrefixSize; prefixSize > 0; prefixSize--) { | |
const [ firstWord, ...otherWords ] = words | |
if (otherWords.every(word => word.substr(0, prefixSize) == firstWord.substr(0, prefixSize))) { | |
return `"${firstWord.substr(0, prefixSize)}"`; |
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
#!/usr/bin/env bash | |
: <<'END_COMMENT' | |
Read man ls and write an ls command that lists files in the following manner | |
Includes all files, including hidden files | |
Sizes are listed in human readable format (e.g. 454M instead of 454279954) | |
Files are ordered by recency | |
Output is colorized | |
END_COMMENT |
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 | |
IN=$(cat << HMARK | |
pacotes= a, b, c | |
testes= 1,2,3,4 | |
HMARK | |
) | |
readarray -t LINES <<< "$IN" | |
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 com.olegon.javadynamodblimit.controller | |
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder | |
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper | |
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression | |
import com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList | |
import com.amazonaws.services.dynamodbv2.model.AttributeValue | |
import com.amazonaws.services.dynamodbv2.model.ReturnConsumedCapacity | |
import com.olegon.javadynamodblimit.entity.Song | |
import org.springframework.web.bind.annotation.GetMapping |
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
using System; | |
using System.Globalization; | |
using System.IO; | |
using System.Threading.Tasks; | |
using ClosedXML.Excel; | |
namespace application | |
{ | |
public class App | |
{ |
NewerOlder