-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
547 lines (316 loc) · 17.6 KB
/
index.html
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
<!DOCTYPE html>
<html lang="en" itemscope itemtype="http://schema.org/WebPage">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>^_^ - ^_^</title>
<meta name="author" content="Akshendra Pratap Singh"/><script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "^_^",
"url": "https:\/\/www.akshendra.com"
}
</script><script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "",
"url": "https:\/\/www.akshendra.com"
}
</script>
<meta property="og:title" content="^_^" />
<meta property="og:image" content="https://www.akshendra.com/img/octocat.png" />
<meta property="og:url" content="https://www.akshendra.com/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="^_^" />
<meta name="twitter:title" content="^_^" />
<meta name="twitter:image" content="https://www.akshendra.com/img/octocat.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@akshendr" />
<meta name="twitter:creator" content="@akshendr" />
<link href='https://www.akshendra.com/favicon.ico' rel='icon' type='image/x-icon'/>
<meta name="generator" content="Hugo 0.62.2" />
<link rel="alternate" href="https://www.akshendra.com/index.xml" type="application/rss+xml" title="^_^"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"><link rel="stylesheet" href="https://www.akshendra.com/css/main.css" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
<link rel="stylesheet" href="https://www.akshendra.com/css/highlight.min.css" /><link rel="stylesheet" href="https://www.akshendra.com/css/codeblock.css" /><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top navbar-custom">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://www.akshendra.com">^_^</a>
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="nav navbar-nav navbar-right">
<li>
<a title="Blog" href="/">Blog</a>
</li>
<li>
<a title="About" href="/about/">About</a>
</li>
<li>
<a title="Tags" href="/tags">Tags</a>
</li>
<li>
<a title="Things" href="/things/">Things</a>
</li>
</ul>
</div>
<div class="avatar-container">
<div class="avatar-img-border">
<a title="^_^" href="https://www.akshendra.com">
<img class="avatar-img" src="https://www.akshendra.com/img/octocat.png" alt="^_^" />
</a>
</div>
</div>
</div>
</nav>
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<div class="pswp__scroll-wrap">
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<header class="header-section ">
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="page-heading">
<h1>^_^</h1>
<hr class="small">
</div>
</div>
</div>
</div>
</div>
</header>
<div role="main" class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="posts-list">
<article class="post-preview">
<a href="https://www.akshendra.com/posts/iterators-i/">
<h2 class="post-title">Iterators in JavaScript</h2>
</a>
<p class="post-meta">
<span class="post-meta">
<i class="fas fa-calendar"></i> Posted on July 29, 2018
| <i class="fas fa-clock"></i> 4 minutes
| <i class="fas fa-book"></i> 664 words
| <i class="fas fa-user"></i> Akshendra Pratap Singh
</span>
</p>
<div class="post-entry">
Many a times you wake up and realize that today you will be traversing through an array or maybe many arrays. But you don't worry about it, you have done it before and it wasn't that difficult. You also have a lot of options, you can use the good old loops, or the wonderful map, reduce, fitler. OR you can use the iterators.
Iterator is a design pattern that allows us to traverse over a list or collection.
<a href="https://www.akshendra.com/posts/iterators-i/" class="post-read-more">[Read More]</a>
</div>
<div class="blog-tags">
<a href="https://www.akshendra.com/tags/node/">node</a>
<a href="https://www.akshendra.com/tags/javascript/">javascript</a>
<a href="https://www.akshendra.com/tags/js/">js</a>
<a href="https://www.akshendra.com/tags/iterators/">iterators</a>
</div>
</article>
<article class="post-preview">
<a href="https://www.akshendra.com/posts/the-madlad-reduce/">
<h2 class="post-title">The beast that is Array.prototype.reduce</h2>
</a>
<p class="post-meta">
<span class="post-meta">
<i class="fas fa-calendar"></i> Posted on June 23, 2018
| <i class="fas fa-clock"></i> 5 minutes
| <i class="fas fa-book"></i> 930 words
| <i class="fas fa-user"></i> Akshendra Pratap Singh
</span>
</p>
<div class="post-entry">
reduce() is an absolute beast of a method when it comes to functional style programming in JavaScript. The more you use it, the more you see use cases popping everywhere for it.
I recently realized, that it has become my goto method, whenever I have to deal with arrays. So I looked through bunch of my code and found a lot of examples, some of which I will list in this post.
<a href="https://www.akshendra.com/posts/the-madlad-reduce/" class="post-read-more">[Read More]</a>
</div>
<div class="blog-tags">
<a href="https://www.akshendra.com/tags/node/">node</a>
<a href="https://www.akshendra.com/tags/javascript/">javascript</a>
<a href="https://www.akshendra.com/tags/reduce/">reduce</a>
<a href="https://www.akshendra.com/tags/functional/">functional</a>
</div>
</article>
<article class="post-preview">
<a href="https://www.akshendra.com/posts/docs-on-fly/">
<h2 class="post-title">Generating documentation on the fly in express</h2>
</a>
<p class="post-meta">
<span class="post-meta">
<i class="fas fa-calendar"></i> Posted on June 9, 2018
| <i class="fas fa-clock"></i> 4 minutes
| <i class="fas fa-book"></i> 800 words
| <i class="fas fa-user"></i> Akshendra Pratap Singh
</span>
</p>
<div class="post-entry">
I little while ago, I decided to generate docs for some HTTP APIs I was about to build. The APIs were going to be used internally, so I didn't want to commit to any of the online solutions, like API Blueprint, Apiary or Swagger. And setting up something from scratch would have been, … bit much. Also, I wanted the docs integrated within the code, avoiding any kind of context switch just to write documentation.
<a href="https://www.akshendra.com/posts/docs-on-fly/" class="post-read-more">[Read More]</a>
</div>
<div class="blog-tags">
<a href="https://www.akshendra.com/tags/node/">node</a>
<a href="https://www.akshendra.com/tags/webdev/">webdev</a>
<a href="https://www.akshendra.com/tags/express/">express</a>
</div>
</article>
<article class="post-preview">
<a href="https://www.akshendra.com/posts/express-reload/">
<h2 class="post-title">Reloading the express server without nodemon</h2>
</a>
<p class="post-meta">
<span class="post-meta">
<i class="fas fa-calendar"></i> Posted on June 5, 2018
| <i class="fas fa-clock"></i> 6 minutes
| <i class="fas fa-book"></i> 1123 words
| <i class="fas fa-user"></i> Akshendra Pratap Singh
</span>
</p>
<div class="post-entry">
I have been using nodemon for reloading express server and any other NodeJs code since I started writing backend NodeJS code. It does what it says on the label and does it pretty well. However, the problem with nodemon is lack of control and the fact that it seems to kill the process. You write a console.log statement and it will restart your whole server, which is all fine and dandy if your server starts quickly.
<a href="https://www.akshendra.com/posts/express-reload/" class="post-read-more">[Read More]</a>
</div>
<div class="blog-tags">
<a href="https://www.akshendra.com/tags/node/">node</a>
<a href="https://www.akshendra.com/tags/webdev/">webdev</a>
<a href="https://www.akshendra.com/tags/express/">express</a>
</div>
</article>
</div>
</div>
</div>
</div>
<div class="page-meta">
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center footer-links">
<li>
<a href="mailto:meine@akshendra.com" title="Email me">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://github.com/akshendra" title="GitHub">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://gitlab.com/kabtr" title="GitLab">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-gitlab fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://twitter.com/akshendr" title="Twitter">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://linkedin.com/in/akshendra-pratap-8b8b75a6" title="LinkedIn">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://stackoverflow.com/users/4130281/akshendra-pratap" title="StackOverflow">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="/index.xml" title="RSS">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="credits copyright text-muted">
<a href="https://akshendra.com">Akshendra Pratap Singh</a>
• ©
2018
•
<a href="https://www.akshendra.com">^_^</a>
</p>
<p class="credits theme-by text-muted">
<a href="https://gohugo.io">Hugo v0.62.2</a> powered • Theme <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> adapted from <a href="https://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>
</p>
</div>
</div>
</div>
</footer><script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://www.akshendra.com/js/main.js"></script>
<script src="https://www.akshendra.com/js/highlight.min.js"></script>
<script> hljs.initHighlightingOnLoad(); </script>
<script> $(document).ready(function() {$("pre.chroma").css("padding","0");}); </script><script> renderMathInElement(document.body); </script><script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.js" integrity="sha384-QELNnmcmU8IR9ZAykt67vGr9/rZJdHbiWi64V88fCPaOohUlHCqUD/unNN0BXSqy" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe-ui-default.min.js" integrity="sha384-m67o7SkQ1ALzKZIFh4CiTA8tmadaujiTa9Vu+nqPSwDOqHrDmxLezTdFln8077+q" crossorigin="anonymous"></script><script src="https://www.akshendra.com/js/load-photoswipe.js"></script>
</body>
</html>