-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3af6ae4
commit a798841
Showing
15 changed files
with
127 additions
and
57 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# q: how's the lunch and learn going? | ||
# q: how's the demo going? | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const token = process.env["TWITTER_TOKEN"] | ||
import d3 from "d3" | ||
|
||
const fetchTweets = | ||
const drawScatterplot |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import d3 from "d3" | ||
const https = require('https'); | ||
const parseString = require('xml2js').parseString; | ||
const apiKey = process.env["GOODREADS_API_KEY"] | ||
|
||
const drawScatterplot | ||
const getRatingFromGoodreads = |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,4 @@ | ||
const https = require('https'); | ||
const parseString = require('xml2js').parseString; | ||
const apiKey = process.env["GOODREADS_API_KEY"] | ||
|
||
const getRatingFromGoodreads = (bookTitle) => { | ||
return new Promise((resolve, reject) => { | ||
const url = `https://www.goodreads.com/book/title.xml?key=${apiKey}&title=${encodeURIComponent(bookTitle)}`; | ||
https.get(url, (res) => { | ||
if (res.statusCode !== 200) { | ||
reject(new Error(`Status code: ${res.statusCode}`)); | ||
} else { | ||
let body = ''; | ||
res.on('data', (chunk) => { body += chunk; }); | ||
res.on('end', () => { | ||
parseString(body, (err, result) => { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(result.GoodreadsResponse.book[0].average_rating[0]); | ||
} | ||
}); | ||
}); | ||
} | ||
}).on('error', (err) => { | ||
reject(err); | ||
}); | ||
}); | ||
} | ||
const v = new Vector([1, 2, 3]); | ||
v.clear(); | ||
console.log(v.size()); | ||
console.log(v.empty()); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
''' | ||
Function to find area of a triangle | ||
''' | ||
#def | ||
#def |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
''' | ||
API Wrapper MethodView blueprint with body for the Flask smorest API | ||
given I post a book | ||
when the API returns an invalid response | ||
then API wrapper should return an error | ||
''' | ||
class | ||
#def |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from github_copilot.index_2 import APIWrapper | ||
|
||
''' | ||
Test the APIWrapper class | ||
1. Function to create 100 random users using faker library | ||
2. Each user should have between 1 and 5 posts | ||
3. The user and the post should be sent to the API via a post request | ||
''' | ||
#def tes | ||
#def |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
''' | ||
given I put an image | ||
when The Post ID is invalid | ||
then API wrapper should return an error | ||
''' | ||
def max_sum_slice(xs): | ||
pass |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
''' | ||
1. Function to create 100 random users using faker library | ||
2. Each user should have between 1 and 5 posts | ||
3. The user and the post should be sent to the API via a post request | ||
''' | ||
def get_code_field(): | ||
pass |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
def max_sum_slice(xs): | ||
pass | ||
import re | ||
|
||
e_regex = r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$' | ||
p_regex = r'^[0-9]{3}-[0-9]{3}-[0-9]{4}$' | ||
s_regex = r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$' | ||
s2_regex = r'^[0-9]{3}-[0-9]{2}-[0-9]{4}$' | ||
|
||
def check_valid(text, regex): | ||
if re.search(regex, text): | ||
print("Valid") | ||
else: | ||
print("Invalid") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
namespace dotnet_copilot.Data; | ||
|
||
// create a speaker class with id, name, and bio | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const token = process.env["TWITTER_TOKEN"] | ||
|
||
const fetchTweets = |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# 1. Specify the version of the AzureRM Provider to use | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "=3.0.1" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
# Create a resource group | ||
resource "azurerm_resource_group" "terraformRG" { | ||
name = "terraformRG" | ||
location = "eastus" | ||
} | ||
|
||
# Create a virtual network in the resource group | ||
resource "azurerm_virtual_network" "terraformVNet" { | ||
name = "terraformVNet" | ||
address_space = ["10.0.0.0/16"] | ||
location = azurerm_resource_group.terraformRG.location | ||
resource_group_name = azurerm_resource_group.terraformRG.name | ||
} | ||
|
||
# Create a subnet in the virtual network | ||
resource "azurerm_subnet" "terraformSubnet" { | ||
name = "internal" | ||
resource_group_name = azurerm_resource_group.terraformRG.name | ||
virtual_network_name = azurerm_virtual_network.terraformVNet.name | ||
address_prefixes = ["10.0.2.0/24"] | ||
} | ||
|
||
# Create a network interface card (nic) for the virtual machine | ||
resource "azurerm_network_interface" "terraformNIC" { | ||
name = "terraformNIC" | ||
location = azurerm_resource_group.terraformRG.location | ||
resource_group_name = azurerm_resource_group.terraformRG.name | ||
|
||
ip_configuration { | ||
name = "internal" | ||
subnet_id = azurerm_subnet.terraformSubnet.id | ||
private_ip_address_allocation = "Dynamic" | ||
} | ||
} | ||
|
||
# Create virtual machine | ||
resource "azurerm_windows_virtual_machine" "terraformVM" { | ||
name = "terraformVM" | ||
resource_group_name = azurerm_resource_group.terraformRG.name | ||
location = azurerm_resource_group.terraformRG.location | ||
size = "Standard_DS1_v2" | ||
admin_username = "adminuser" | ||
admin_password = "P@$$w0rd1234!" | ||
network_interface_ids = [ | ||
azurerm_network_interface.terraformNIC.id, | ||
] | ||
|
||
os_disk { | ||
caching = "ReadWrite" | ||
storage_account_type = "Standard_LRS" | ||
} | ||
|
||
source_image_reference { | ||
publisher = "MicrosoftWindowsServer" | ||
offer = "WindowsServer" | ||
sku = "2016-Datacenter" | ||
version = "latest" | ||
} | ||
} | ||
|
||
# Can access data that was accessed somewhere else | ||
data "azurerm_resource_group" "terraformRG" { | ||
name = "terraformRG" | ||
} | ||
|
||
output "id" { | ||
value = data.azurerm_resource_group.terraformRG.id | ||
} |