Skip to content

Instantly share code, notes, and snippets.

View vaquarkhan's full-sized avatar
:octocat:
while( !(succeed=try())){}

Vaquar Khan vaquarkhan

:octocat:
while( !(succeed=try())){}
View GitHub Profile

AWS Resource-Based Policy Examples

@vaquarkhan
vaquarkhan / How-to.txt
Created September 20, 2021 23:40 — forked from chicagobuss/How-to.txt
lambda-to-kafka
# First I created a working directory
~$ mkdir s3-kafka
# Then I installed the dependency I needed in that directory with pip
~$ cd s3-kafka
~$ pip install kafka-python -t $(pwd)
# Then I put my code into a file called s3-kafka.py
~$ vi s3-kafka.py
@mmafrar
mmafrar / FileServiceNew.java
Created March 24, 2021 15:49
Working with Amazon S3 presigned URLs in Spring Boot
package com.example.demo;
import com.amazonaws.HttpMethod;
import com.amazonaws.services.s3.AmazonS3;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@vaquarkhan
vaquarkhan / Frog Jump
Last active January 3, 2021 01:44
Google Coding
// https://leetcode.com/problems/frog-jump/
/*
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone.
The frog can jump on a stone, but it must not jump into the water.
Given a list of stones' positions (in units) in sorted ascending order,
determine if the frog is able to cross the river by landing on the last stone. Initially,
the frog is on the first stone and assume the first jump must be 1 unit.
If the frog's last jump was k units, then its next jump must be either k - 1, k, or k + 1 units.
Note that the frog can only jump in the forward direction.
Note:
@vaquarkhan
vaquarkhan / interviewitems.MD
Created December 25, 2020 08:30 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@vaquarkhan
vaquarkhan / Algorithm-Java-programming- Arrays
Last active August 15, 2021 05:52
Algorithm-Java-programming- Arrays
My learning
@andrisro
andrisro / S3PresignedUrlExpirationEnum.java
Created May 8, 2019 08:56
Java AWS S3 Presigned URI Example
import java.util.Date;
public enum S3PresignedUrlExpiration {
PURI_UPLOAD_FILE(1000 * 2), PURI_READ_FILE(1000 * 1);
private final long expirationTime;
S3PresignedUrlExpiration(long expirationTime) {
this.expirationTime = expirationTime;
}
@enryold
enryold / FnEncodeBytesAsFirehose.java
Last active September 8, 2021 06:48
Java classes for Kinesis Firehose record transformation lambda
import com.amazonaws.protocol.json.JsonClientMetadata;
import com.amazonaws.protocol.json.SdkJsonProtocolFactory;
import com.amazonaws.protocol.json.StructuredJsonGenerator;
import com.amazonaws.services.kinesisfirehose.model.Record;
import com.amazonaws.services.kinesisfirehose.model.transform.RecordJsonMarshaller;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.nio.ByteBuffer;
import java.util.function.Function;
@pratos
pratos / requirements.txt
Created October 22, 2017 19:27
Requirements.txt for Tensorflow image
bleach==1.5.0
certifi==2016.2.28
cycler==0.10.0
decorator==4.1.2
entrypoints==0.2.3
html5lib==0.9999999
ipykernel==4.6.1
ipython==6.2.1
ipython-genutils==0.2.0
ipywidgets==7.0.3