-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes
221 lines (156 loc) · 9.37 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
****** This is the general notes file it contains the following *******
1. Helper notes about Node/other code;
2. Database definitions;
*** Helper Notes ***
*** Launching The App
How to run the app: DEBUG=chip:*
*** GIT Stuff ***
To push to GIT hub:
git add .
git commit -m "Description"
git push origin master
To see remotes:
git remote -v
To push to Heroku:
git push heroku master
*** Postgres ***
How to see all current tables: \dt *.*
How to create a new user:
CREATE USER tester WITH PASSWORD 'test_password';
GRANT ALL PRIVILEGES ON DATABASE "test_database" to tester;
Connection from terminal as master:
psql -h chip-db.cclyf5gm9q8m.us-west-2.rds.amazonaws.com -U the_annual_chip -p 5432 -d the_annual_chip
password: the_annual_chip
Connection from terminal as tom:
psql -h chip-db.cclyf5gm9q8m.us-west-2.rds.amazonaws.com -U tom -p 5432 -d the_annual_chip
password: the_annual_chip
Connection from terminal as sam:
psql -h chip-db.cclyf5gm9q8m.us-west-2.rds.amazonaws.com -U sam -p 5432 -d the_annual_chip
password: the_annual_chip
*** Database Definitions ***
DB Instance Identifier: chip-db
Master User Name: the_annual_chip
Master Password: the_annual_chip
DB Name: the_annual_chip
** Bets Table **
CREATE TABLE bets(
gambler_1 VARCHAR,
gambler_2 VARCHAR,
judge VARCHAR,
amount REAL,
bet_comment VARCHAR,
date_created TIMESTAMP WITH TIME ZONE,
accepted BOOLEAN,
date_accepted TIMESTAMP WITH TIME ZONE,
winner VARCHAR,
date_won TIMESTAMP WITH TIME ZONE
);
** Golf Scores Table **
CREATE TABLE scores(
username varchar(50),
day integer,
hole integer,
score integer,
PRIMARY KEY( username, day, hole )
);
* Add some dummy data *
INSERT INTO scores (username, day, hole, score)
VALUES ('T Bish', 1, 1, 4);
INSERT INTO scores (username, day, hole, score)
VALUES ('T Bish', 1, 2, 4);
INSERT INTO scores (username, day, hole, score)
VALUES ('Sammy B', 1, 1, 3);
INSERT INTO scores (username, day, hole, score)
VALUES ('Sammy B', 1, 2, 6);
** Weekend Schedule **
CREATE TABLE weekend_schedule(
day INTEGER,
course VARCHAR(50),
num_holes INTEGER,
PRIMARY KEY(day)
);
* Temp Data *
INSERT INTO weekend_schedule (day, course, num_holes)
VALUES (1, 'flinders', 9);
INSERT INTO weekend_schedule (day, course, num_holes)
VALUES (2, 'flinders', 18);
INSERT INTO weekend_schedule (day, course, num_holes)
VALUES (3, 'flinders', 9);
** Hole Info Table **
CREATE TABLE hole_info(
course VARCHAR(50),
hole INTEGER,
par INTEGER,
distance INTEGER,
pro_tip VARCHAR(500),
hole_diagram VARCHAR(50),
PRIMARY KEY(course, hole)
);
* Flinders Golf Course Data *
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 1, 4, 230, 'Short par 4 to ease you into your round. Classic risk and reward as it invites you “have a go” at the well guarded green.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 2, 4, 290, 'Tough tee shot with OOB down the left side and a fairway bunker on the right. Approach shot is into narrow entrance guarded by bunkers on either side.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 3, 3, 189, 'Long par 3 with all the trouble pin high and beyond. Par is more easily achieved if short of the green rather than long.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 4, 4, 256, 'Risk and reward personified here. Almost as if the flag is waving at you enticing you to have a go. It''s dead left and long and there''s also 2 coffins to contend with. One is 150 metres from the tee which swallows any mishit tee shots and the other just before the green to swallow mishit approaches. Both offer unpredictable lies. Leave the Superman cloak in the bag, play safe and don''t leave yourself a downhill putt.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 5, 5, 419, 'Reachable Par 5 all dependent on the tee shot. Tight driving hole with OOB on left side and lots of fairway bunkers to catch your ball. Take time to enjoy the view on your left hand side.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 6, 4, 349, 'Tough Par 4 uphill all the way again with OOB on left hand side. Club selection is key as approach shots not hit to the middle of green or beyond usually roll back off the sloping green.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 7, 4, 394, 'Great looking long Par 4 slightly uphill with difficult tee shot, needing to be long to avoid the dam on the right. Always wise to take an extra club into this green as the uphill slope is deceiving.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 8, 4, 315, 'Another great driving hole. Beware fairway bunkers awaiting any ball left side of a sloping fairway on this dog leg left hole and the green side bunkers on right are a must to avoid.','na');
INSERT INTO hole_info (course, hole, par, distance,pro_tip, hole_diagram)
VALUES ('flinders', 9, 3, 161, 'Par 3 at the top of the course and club selection varies depending on wind. There never feels like there''s much wind on the protected tee but there always is. Much easier to make a 3 if your tee shot is from short of the green. Phil Mickelson can''t get up and down from the green side trap left!','na');
INSERT INTO hole_info (course, hole, par, distance,pro_tip, hole_diagram)
VALUES ('flinders', 10, 4, 312,'Straightforward Par 4 with tricky green sloping from back to front. Leave an uphill putt.', 'na');
INSERT INTO hole_info (course, hole, par, distance,pro_tip, hole_diagram)
VALUES ('flinders', 11, 4, 257, 'Well protected Par 4 which favours the long hitters. Long and down the left side offers the easier approach. Short hitters might prefer laying up down the left side as green is almost impossible to land anything other than a wedge on, if you want the ball to stay on the green.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 12, 3, 124, 'Beautiful tee shot fully exposed to the elements. With bunkers front and left, grassy hollows to the right and a sloping green to the ocean, par is difficult to achieve if the green is missed.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 13, 4, 342, 'Tight dog leg left with lots of risk and reward on offer. Drive over the corner of the left trees will allow a short iron in, whereas the short hitters will face a long blind second shot.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 14, 3, 128, 'Par 3 that can be anything from Driver to Sandwedge depending on conditions. Better short than long here as trees protect the back end of the green.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 15, 5, 454, 'Long Par 5 aptly named in the cooler months of the year. The hole is just as you see it and the green can be reached in 2, but is more receptive to a short iron into it.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 16, 4, 298, 'A driver isn''t always needed as this tight fairway is guarded by Pines down the left and 3 bunkers down the right. Wind conditions play a part in the approach. Beware!','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 17, 3, 159, 'Long Par 3 with most of the trouble long. Play short rather than long.','na');
INSERT INTO hole_info (course, hole, par, distance, pro_tip,hole_diagram)
VALUES ('flinders', 18, 4, 290, 'Tough tee shot to an uphill dogleg left fairway, with trouble all around. Lots of cards ruined on this hole. Longer hitter might be advised to lay up with a hybrid to avoid running thru fairway into trees. On approach, not many up and downs happen from over the green.','na');
** Photos Table **
Starting with the pics stored locally and manually entering the log details
Will update later
* Add some dummy data *
INSERT INTO photos (photo_title, uploaded_user, date_uploaded)
VALUES ('tom.jpg', 'T Bish', to_date('2017-06-21', 'YYYY-MM-DD'));
INSERT INTO photos (photo_title, uploaded_user, date_uploaded)
VALUES ('sam.jpg','Sammy B', to_date('2017-06-21', 'YYYY-MM-DD'));
INSERT INTO photos (photo_title, uploaded_user, date_uploaded)
VALUES ('gimp.jpg', 'Gimp', to_date('2017-06-21', 'YYYY-MM-DD'));
*** Tom Javascript Helpers ***
** THis is a switch statement **
switch(lboard[i].username) {
case "T Bish":
img = "tom.jpg";
break;
case "Sammy B":
img = "sam.jpg";
break;
};
** Multiline strings **
Use the multiline package (cause of course you're not allowed)
multiline_string = multline(function(){/*
your string here
*/
****
logins:
crit
cal