Skip to content

Instantly share code, notes, and snippets.

View mamiwinsfall93's full-sized avatar

Ndatta Fall mamiwinsfall93

  • Bowie, Maryland
View GitHub Profile
@mamiwinsfall93
mamiwinsfall93 / JAVA
Created January 18, 2020 17:18
Salesman employee classes with salary information
** Filename: Employee.java
* Author: Ndatta Fall
* Purpose: Salesman employee classes with salary information
*
*/
public class Salesman extends Employee{
private int annualSales;// to store annual sales
@mamiwinsfall93
mamiwinsfall93 / JAVA
Created January 18, 2020 17:18
Purpose: Executive employee classes with salary information
/** Filename: Employee.java
* Author: Ndatta Fall
* Purpose: Executive employee classes with salary information
*
*/
public class Executive extends Employee{
private int stockPrice;
@mamiwinsfall93
mamiwinsfall93 / JAVA
Created January 18, 2020 17:17
Calculates salary for different types of employees, and displays their information
/** Filename: Endingclass.java
* Author: Ndatta Fall
*
* Purpose of Program: Calculates salary for different types of employees, and displays their information
*/
import java.io.File;
import java.io.FileNotFoundException;
@mamiwinsfall93
mamiwinsfall93 / JAVA
Created January 18, 2020 17:16
Employee, classes with salary information
/** Filename: Employee.java
* Author: Ndatta Fall
*
* Purpose: Employee, classes with salary information
*
*/
public class Employee {
<?php
if(isset($_POST['submit'])){
$name_bad = $_POST['name'];
$name_bad = mysql_real_escape_string($name_bad);
$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'";
echo "<span style='color:green'>Escaped Bad Injection: <br />" . $query_bad . "<br />";
echo "mysql_real_escape_string() function has helped escape mysql injections<br><br></span>";
}
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
// user input that uses SQL Injection
$name_bad = $_POST['name'];
$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'";
// display what the new query will look like, with injection
echo "<span style='color:red'>Injection: " . $query_bad."<br>";
@mamiwinsfall93
mamiwinsfall93 / Lambda
Created January 18, 2020 17:01
python and aws
def lambda_handler(event, context):
print_log(context)
area_of_triangle = get_area_of_triangle(event)
return {
'area_of_triangle' : area_of_triangle
}
def get_area_of_triangle(event):
b = int(event['base'])
h = int(event['height'])
mport boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('courses')
print(table.creation_date_time)
with table.batch_writer() as batch:
batch.put_item(
Item={
'courseID':2,
'Title': 'Building Secure Web Applications',
mport boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('courses')
print(table.creation_date_time)
with table.batch_writer() as batch:
batch.put_item(
Item={
'courseID':2,
'Title': 'Building Secure Web Applications',
import boto3
# Get the service resource.
dynamodb = boto3.resource('dynamodb')
# Create the DynamoDB table.
table = dynamodb.create_table(
TableName='courses',
KeySchema=[
{
'AttributeName': 'courseID',