This file contains hidden or 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
| const AWS = require('aws-sdk'); | |
| AWS.config.update({region: 'eu-west-1'}); | |
| const dynamodb = new AWS.DynamoDB(); | |
| const params = { | |
| ExpressionAttributeValues: { | |
| ':v1': { | |
| S: 'aod' |
This file contains hidden or 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
| // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatch.html#putMetricData-property | |
| const AWS = require("aws-sdk"); | |
| const cloudwatch = new AWS.CloudWatch({ | |
| accessKeyId: process.env.AWS_ACCESS_KEY_ID, | |
| secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, | |
| sessionToken: process.env.AWS_SESSION_TOKEN, | |
| region: process.env.AWS_REGION | |
| }); |
This file contains hidden or 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
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| (async () => { | |
| try { | |
| const mediaStream = await navigator.mediaDevices.getUserMedia({ | |
| audio: true, | |
| video: true | |
| }); |
This file contains hidden or 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
| import fs from 'fs'; | |
| export class Dials { | |
| private file: string; | |
| private dials: object; | |
| constructor(file: string) { | |
| this.file = file; | |
| try { |
This file contains hidden or 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
| # Using groupby() and count() | |
| df2 = df.groupby(['A'])['A'].count() | |
| # Using GroupBy & count() on multiple column | |
| df2 = df.groupby(['A','B'])['C'].count() | |
| # Using GroupBy & size() on multiple column | |
| df2 = df.groupby(['A','B'])['C'].size() | |
| # using DataFrame.size() and max() |
This file contains hidden or 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
| def detect_features(data_frame): | |
| numerical = [] | |
| categorical = [] | |
| for name, type in dict(data_frame.dtypes).items(): | |
| if type == 'object': | |
| categorical.append(name) | |
| else: | |
| numerical.append(name) | |
| return { |
This file contains hidden or 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
| package database; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.ResultSet; | |
| import java.sql.SQLException; | |
| import java.sql.Statement; | |
| public class Database { |
This file contains hidden or 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
| package urlauthentication; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.net.HttpURLConnection; | |
| import java.net.MalformedURLException; | |
| import java.net.URL; | |
| public class UrlConnection { |
This file contains hidden or 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
| #include <iostream> | |
| #include <string> | |
| #include <curl/curl.h> | |
| using namespace std; | |
| static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) { | |
| ((std::string*)userp)->append((char*)contents, size * nmemb); | |
| return size * nmemb; | |
| } |
This file contains hidden or 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
| # To synchronise a local folder to a non-empty remote repo | |
| git init | |
| git remote add origin https://github.com/simonespa/repo.git | |
| git pull origin main | |
| git push -u origin main |