-
Notifications
You must be signed in to change notification settings - Fork 3
/
answer.js
192 lines (129 loc) · 8.9 KB
/
answer.js
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
function getAnswer(question) {
const relatedQuotes = quotes.filter(function(quote) {
const matches = question.toLowerCase().split(/\s/).filter(function(word) {
return word.length > 4 &&
quote.quote.toLowerCase()
.includes(word.replace(/[^\a-z]/, ''))
})
return matches.length > 0
})
if(relatedQuotes.length > 0) {
return relatedQuotes[Math.floor(Math.random() * relatedQuotes.length)]
} else {
return quotes[Math.floor(Math.random() * quotes.length)]
}
}
const quotes = [
{quote: "You can trivially pick up $5,000 in salary negotiations just by sucking less",
url: "https://www.kalzumeus.com/2012/01/23/salary-negotiation/"},
{quote: "Virtually any amount of money available to you personally is mouse droppings to your prospective employer",
url: "https://www.kalzumeus.com/2012/01/23/salary-negotiation/"},
{quote: "Resumes are an institution created to mean that no one has to read resumes",
url: "https://www.kalzumeus.com/2012/01/23/salary-negotiation/"},
{quote: "Negotiating never makes (worthwhile) offers worse",
url: "https://www.kalzumeus.com/2012/01/23/salary-negotiation/"},
{quote: "Never give a number",
url: "https://www.kalzumeus.com/2012/01/23/salary-negotiation/"},
{quote: "Of course you can",
url: "https://www.kalzumeus.com/2012/01/23/salary-negotiation/"},
{quote: "The price for anything (including you) is a function of the supply of it and demand for it",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Software solves business problems",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Engineers are hired to create business value, not to program things",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "You really want to be attached to profit centers",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Don’t call yourself a programmer",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "You are not defined by your chosen software stack",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Co-workers and bosses are not usually your friends",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "You radically overestimate the average skill of the competition because of the crowd you hang around with",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Networking: it isn’t just for TCP packets",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Academia is not like the real world",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "People who are skilled in negotiation make more than those who are not",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Working in a startup is a career path but, more than that, it is a lifestyle choice",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Your most important professional skill is communication",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "You will often be called to do Enterprise Sales and other stuff you got into engineering to avoid",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "Modesty is not a career-enhancing character trait",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "All business decisions are ultimately made by one or a handful of multi-cellular organisms closely related to chimpanzees, not by rules or by algorithms",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "At the end of the day, your life happiness will not be dominated by your career",
url: "https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/"},
{quote: "I have never seen a computer system which handles names properly and doubt one exists, anywhere",
url: "https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/"},
{quote: "All of these assumptions are wrong",
url: "https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/"},
{quote: "Time can be stored",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Not all time debt comes from intrinsically negative activities",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Every line of code you write is time debt",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Pick your problem well",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Avoid setting publicly visible deadlines",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Cultivate relationships with effective freelancers",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Understand the two types of time",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Avoid events, plan for processes",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Document. Everything.",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Keep A routine, when appropriate",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Seek the advice of folks you trust. Disregard some of it.",
url: "https://www.kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/"},
{quote: "Your AdWords strategy is very sensitive to conversion rates",
url: "https://www.kalzumeus.com/2009/09/05/desktop-aps-versus-web-apps/"},
{quote: "Web applications are easier to support",
url: "https://www.kalzumeus.com/2009/09/05/desktop-aps-versus-web-apps/"},
{quote: "Long cycles mean low innovation. Short cycles mean fast innovation.",
url: "https://www.kalzumeus.com/2009/09/05/desktop-aps-versus-web-apps/"},
{quote: "Pancake buttons work",
url: "https://www.kalzumeus.com/2009/03/07/how-to-successfully-compete-with-open-source-software/"},
{quote: "User Experience never ends",
url: "https://www.kalzumeus.com/2009/03/07/how-to-successfully-compete-with-open-source-software/"},
{quote: "SEO has a lot of opportunities for micro-optimizations in it",
url: "https://www.kalzumeus.com/2010/01/24/startup-seo/"},
{quote: "Get something out the door as soon as possible",
url: "https://www.kalzumeus.com/2010/01/24/startup-seo/"},
{quote: "Focus on search terms you can win",
url: "https://www.kalzumeus.com/2010/01/24/startup-seo/"},
{quote: "Good SEO can make your startup",
url: "https://www.kalzumeus.com/2010/01/24/startup-seo/"},
{quote: "Identify risks to your service",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "Software systems are also, overwhelmingly, killed by their moving parts",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "Your system is most vulnerable where it sees dynamism, complexity, and change",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "Never call an external API from within an HTTP request/response cycle",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "You are the least reliable component of your system",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "If you have to do it more than once, it should be automated or made into a checklist",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "Automation is your friend",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "Be notified of failures in a timely manner",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "Learn from failures to prevent re-occurrence",
url: "https://www.kalzumeus.com/2010/04/20/building-highly-reliable-websites-for-small-companies/"},
{quote: "You can probably stand to charge more",
url: "https://www.kalzumeus.com/2006/08/14/you-can-probably-stand-to-charge-more/"},
{quote: "Charge More",
url: "https://www.kalzumeus.com/2006/08/14/you-can-probably-stand-to-charge-more/"},
]