Skip to content

Instantly share code, notes, and snippets.

View sakibguy's full-sized avatar
🎯
p.java

Sakibur Rahman sakibguy

🎯
p.java
View GitHub Profile
@sakibguy
sakibguy / MainActivity.java
Created December 3, 2021 16:53 — forked from anonymous/MainActivity.java
Activity Lifecycle exercise
package com.example.android.lifecycle;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
### [vcs] Data Science
_Step 1: You have a local version of this repository on your laptop, and to get the latest stable version, you pull from the develop branch.
Switch to the develop branch
git checkout develop
Pull the latest changes in the develop branch
git pull
@sakibguy
sakibguy / NumbersActivity.java
Created December 5, 2021 12:30 — forked from anonymous/NumbersActivity.java
Miwok app: OnAudioFocusChangeListener declaration from NumberActivity
/**
* This listener gets triggered whenever the audio focus changes
* (i.e., we gain or lose audio focus because of another app or device).
*/
private AudioManager.OnAudioFocusChangeListener mOnAudioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() {
@Override
public void onAudioFocusChange(int focusChange) {
if (focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT ||
focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
// The AUDIOFOCUS_LOSS_TRANSIENT case means that we've lost audio focus for a
@sakibguy
sakibguy / activity_main.xml
Created December 9, 2021 06:44 — forked from udacityandroid/activity_main.xml
Miwok app: Category screen with pressed states
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tan_background"
android:orientation="vertical"
tools:context="com.example.android.miwok.MainActivity">
<!-- Numbers category -->
@sakibguy
sakibguy / list_item.xml
Created December 9, 2021 07:21 — forked from udacityandroid/ list_item.xml
Miwok App: Miwok app: List Item Views with pressed states
<?xml version="1.0" encoding="utf-8"?>
<!-- Layout for a single list item -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height"
android:background="@color/tan_background"
android:orientation="horizontal">
@sakibguy
sakibguy / Code to go into NumberFragment.java
Created December 17, 2021 07:10 — forked from udacityandroid/Code to go into NumberFragment.java
Copy code from the NumbersActivity and paste it into the NumbersFragment
/** Handles playback of all the sound files */
private MediaPlayer mMediaPlayer;
/** Handles audio focus when playing a sound file */
private AudioManager mAudioManager;
/**
* This listener gets triggered whenever the audio focus changes
* (i.e., we gain or lose audio focus because of another app or device).
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.word_list);
// Create and setup the {@link AudioManager} to request audio focus
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
// Create a list of words
final ArrayList<Word> words = new ArrayList<Word>();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sakibguy
sakibguy / Amazon SES IAM Policy
Created December 29, 2021 10:55 — forked from nktstudios/Amazon SES IAM Policy
Amazon SES IAM Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ses:SendEmail",
"ses:SendRawEmail"
],
"Resource": "*"
@sakibguy
sakibguy / AWS Lambda Function to Send Email
Created December 29, 2021 10:55 — forked from nktstudios/AWS Lambda Function to Send Email
AWS Lambda Function to Send Email
import json
import boto3
def lambda_handler(event, context):
ses = boto3.client('ses')
body = """
Hello and welcome to the SES Lambda Python Demo.