forked from swapagarwal/geeksay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeeksay.js
144 lines (139 loc) · 3.25 KB
/
geeksay.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
var translations = {
"save": "ctrl+s",
"break": "<br>",
"control": "ctrl",
"rule": "ctrl",
"escape": "esc",
"black": "#000",
"white": "#fff",
"bang": "!",
"not": "!",
"new": "ctrl+n",
"open": "ctrl+o",
"anchor": "<a>",
"bold": "<b>",
"cut": "ctrl+x",
"copy": "ctrl+c",
"paste": "ctrl+v",
"quit": "ctrl+q",
"close": "ctrl+w",
"help": "f1",
"rename": "f2",
"undo": "ctrl+z",
"redo": "ctrl+y",
"search": "ctrl+f",
"find": "ctrl+f",
"replace": "ctrl+r",
"print": "ctrl+p",
"get": "git",
"got": "git",
"home": "127.0.0.1",
"house": "127.0.0.1",
"local": "127.0.0.1",
"localhost": "127.0.0.1",
"fuck": "fork",
"hello": "ping",
"hi": "ping",
"hey": "ping",
"command": "cmd",
"forget": "ctrl+z",
"world": "0.0.0.0/0",
"want": "require",
"name": "alias",
"address": "url",
"pie": "π",
"function": "fn",
"kill": "ctrl+c",
"stop": "abort",
"refresh": "f5",
"slow": "O(n^n)",
"fast": "O(1)",
"leet": "1337",
"hacker": "haxor",
"geek": "g33k",
"plus": "+",
"minus": "-",
"and": "&&",
"or": "||",
"binary": "01",
"call": "ping",
"me": "self",
"owner": "admin",
"god": "root",
"please": "sudo",
"at": "@",
"fix": "debug",
"shit": "dump",
"bullshit": "dump",
"poop": "dump",
"delete": "del",
"force": "ma",
"coffee": "covfefe",
"number": "#",
"image": "img",
"photo": "img",
"pic": "img",
"picture": "img",
"snap": "img",
"snapshot": "img",
"bye": "exit",
"noob": "n00b",
"life": "42",
"universe": "42",
"everything": "42",
"lifetime": "runtime",
"sleep": "shutdown"
}
var quotes = [
"Hello World",
"Bye World",
"Forget that ever happened",
"Home is where the heart is",
"Home is where ideas come to life",
"Home is where the wifi connects automatically",
"fuck that shit",
"go hard or go home",
"I will call you",
"I want the world to know me",
"I am the owner",
"I am God",
"please make me a sandwich",
"coffee is life",
"what's your name",
"I will find you and I will fix you!",
"geek alert",
"geek inside",
"copy that!",
"get out of home",
"not everything is black and white",
"to be or not to be, that is the question",
"i was 5 and he was 6",
"he wore black and i wore white",
"bang bang my baby shot me down",
"Today is the first day of the rest of your lifetime",
"i need to sleep"
]
function isNumeric(num){
return !isNaN(parseInt(num));
}
function geeksay(text) {
if(isNumeric(text)) {
return (text >>> 0).toString(2);
}
else {
lowerCaseText = text.toLowerCase();
if (translations.hasOwnProperty(lowerCaseText)) {
return translations[lowerCaseText];
} else {
return text;
}
}
}
function getRandomTranslation() {
var keys = Object.keys(translations);
var randomKey = keys[Math.floor(Math.random() * keys.length)];
return "Random Translation: " + randomKey + " -> " + translations[randomKey];
}
function getRandomQuote() {
return quotes[Math.floor(Math.random() * quotes.length)];
}