Skip to content

Instantly share code, notes, and snippets.

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

sakibguy

🎯
p.java
View GitHub Profile
@sakibguy
sakibguy / Excerpt from QueryUtils.java
Created April 2, 2022 06:16 — forked from anonymous/Excerpt from QueryUtils.java
Sample JSON response with wide spectrum of earthquake magnitude values
/** Sample JSON response for a USGS query */
private static final String SAMPLE_JSON_RESPONSE = "{\"type\":\"FeatureCollection\",\"metadata\":{\"generated\":1462295443000,\"url\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2016-01-01&endtime=2016-01-31&minmag=6&limit=10\",\"title\":\"USGS Earthquakes\",\"status\":200,\"api\":\"1.5.2\",\"limit\":10,\"offset\":1,\"count\":10},\"features\":[{\"type\":\"Feature\",\"properties\":{\"mag\":0.2,\"place\":\"88km N of Yelizovo, Russia\",\"time\":1454124312220,\"updated\":1460674294040,\"tz\":720,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us20004vvx\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us20004vvx&format=geojson\",\"felt\":2,\"cdi\":3.4,\"mmi\":5.82,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":798,\"net\":\"us\",\"code\":\"20004vvx\",\"ids\":\",at00o1qxho,pt16030050,us20004vvx,gcmt20160130032510,\",\"sources\":\",at,pt,us,gcmt,\",\"types\":\",cap,dyfi,finite-fault,genera
@sakibguy
sakibguy / AndroidManifest.xml
Created March 26, 2022 14:33 — forked from codinginflow/AndroidManifest.xml
Navigation Drawer Tutorial Part 1
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codinginflow.navigationdrawerexample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@sakibguy
sakibguy / AndroidManifest.xml
Created March 26, 2022 14:33 — forked from codinginflow/AndroidManifest.xml
Navigation Drawer Tutorial Part 2
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codinginflow.navigationdrawerexample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@sakibguy
sakibguy / AndroidManifest.xml
Created March 26, 2022 14:32 — forked from codinginflow/AndroidManifest.xml
Navigation Drawer Tutorial Part 3
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codinginflow.navigationdrawerexample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@sakibguy
sakibguy / gaussian-code-exercise
Last active January 23, 2022 07:11
Credit: Udacity AWS ML... Gaussian Code Exercise Read through the code below and fill out the TODOs. You'll find a cell at the end of the Jupyter notebook containing unit tests. After you've run the code cell with the Gaussian class, you can run the final cell to check that your code functions as expected. For this exercise, you will use a file …
import math
import matplotlib.pyplot as plt
class Gaussian():
""" Gaussian distribution class for calculating and
visualizing a Gaussian distribution.
Attributes:
mean (float) representing the mean value of the distribution
stdev (float) representing the standard deviation of the distribution
@sakibguy
sakibguy / lambda_function.py
Created January 7, 2022 12:23 — forked from nktstudios/lambda_function.py
AWS Lambda Deployment Package in Python
import json
import pandas as pd
import numpy as np
import requests
def lambda_handler(event, context):
pandas_version = pd.__version__
numpy_version = np.__version__
lambda function
----
exports.handler = async (event) => {
console.log(event)
const customerId = event.pathParameters.customerId;
const customer = {'customerId': customerId, 'customerName': "Customer " + customerId };
const response = {
statusCode: 200,
// Uncomment below to enable CORS requests
headers: {
@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.
@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": "*"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.