Skip to content

Instantly share code, notes, and snippets.

class Visitor {
String visitorName;
String emailAddress;
String mobileNumber;
String whoToSee;
String purposeOfVisit;
String carPlateNumber;
/// Using Timestamp -- Can be converted to Date using Timestamp.toDate()
Timestamp signedInAt;
@Gogetter
Gogetter / create-firebase-project.md
Last active February 26, 2019 20:17
creating a firebase project
  • Add a project on Firebase Console
  • Add an Android app and follow instructions on the wizard
  • Add an iOS and also follow the instructions on the wizard. Skip the steps named Add Firebase SDK and Add initialization code in the Firebase assistant.

Note: You might want to stick to the firebase-core version specified in the wizard above as upgrading to the latest could result in gradle not compiling.

More details covered here

@Gogetter
Gogetter / create-flutter-project.md
Last active February 26, 2019 20:09
steps for creating a flutter project
  • Install Android studio. You can download from here
  • Install Flutter. Download from here
  • Install Dart and Flutter plugins for Android Studio. Derailed instructions covered here
  • Create a Flutter app. Detailed instructions covered here
dependencies:
cloud_firestore: ^0.9.5+2
flutter:
sdk: flutter
-- select 1000 rows of all columns from dataset
select top (1000) *
from Consumer_Complaints;
-- select all rows of a few columns from dataset
SELECT product_name, sub_product, issue, state_name
FROM Consumer_Complaints;
-- select all rows of a few columns from dataset where state_name='NJ'
select product_name, issue, state_name
# Use the official microsoft image found -> https://hub.docker.com/_/microsoft-mssql-server
FROM mcr.microsoft.com/mssql/server:2017-latest
# Define environment variables
ENV ACCEPT_EULA=Y
ENV SA_PASSWORD=MySoVery3tr045Pass3!o79
# Download test data which we will upload to a table and query
ADD https://github.com/Gogetter/blog-posts-database/raw/dockerze-mssql/ConsumerComplaints.csv /home/sql/dataset/
-- Delete database if already exists. This enables us to run without errors
drop database if exists ConsumerComplaint
go
-- create the ConsumerComplaint database
create database ConsumerComplaint
GO
-- use just created database
Use ConsumerComplaint;
Command Description
docker exec -it dev-mssql-server 'bash' Connects to contains in interactive bash mode
mkdir -p /home/sql/dataset Create directories sql and dataset
cd /home/sql/dataset Change directory to just created directory
wget https://github.com/Gogetter/blog-posts-database/raw/dockerze-mssql/ConsumerComplaints.csv Download demo data
docker exec -it dev-mssql-server "bash"
mkdir -p /home/sql/dataset
cd /home/sql/dataset
wget "https://github.com/Gogetter/blog-posts-database/raw/dockerze-mssql/ConsumerComplaints.csv"
We can't make this file beautiful and searchable because it's too large.
Date Received,Product Name,Sub Product,Issue,Sub Issue,Consumer Complaint Narrative,Company Public Response,Company,State Name,Zip Code,Tags,Consumer Consent Provided,Submitted via,Date Sent to Company,Company Response to Consumer,Timely Response,Consumer Disputed,Complaint ID
2013-07-29,Consumer Loan,Vehicle loan,Managing the loan or lease,,,,Wells Fargo & Company,VA,24540,,N/A,Phone,2013-07-30,Closed with explanation,Yes,No,468882
2013-07-29,Bank account or service,Checking account,Using a debit or ATM card,,,,Wells Fargo & Company,CA,95992,Older American,N/A,Web,2013-07-31,Closed with explanation,Yes,No,468889
2013-07-29,Bank account or service,Checking account,"Account opening, closing, or management",,,,Santander Bank US,NY,10065,,N/A,Fax,2013-07-31,Closed,Yes,No,468879
2013-07-29,Bank account or service,Checking account,Deposits and withdrawals,,,,Wells Fargo & Company,GA,30084,,N/A,Web,2013-07-30,Closed with explanation,Yes,No,468949
2013-07-29,Mortgage,Conventional fixed mortgage,"Loan servicing, paym