/
index.html
644 lines (322 loc) · 20.5 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
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image" content="https://www.drzon.net/images/cover.jpg"/>
<meta name="twitter:title" content="Code and stuff"/>
<meta name="twitter:description" content=""/>
<meta name="twitter:site" content="@mderazon"/>
<meta property="og:title" content="Code and stuff" />
<meta property="og:site_name" content="Code and stuff" />
<meta property="og:url" content="https://www.drzon.net/" />
<meta property="og:image" content="https://www.drzon.net/images/cover.jpg"/>
<meta property="og:type" content="website" />
<meta property="og:description" content="" />
<title>Code and stuff</title>
<meta name="description" content="" />
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="https://www.drzon.net/images/favicon.ico">
<link rel="apple-touch-icon" href="https://www.drzon.net/images/apple-touch-icon.png" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://www.drzon.net/css/screen.css" />
<link rel="stylesheet" type="text/css" href="https://www.drzon.net/css/nav.css" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700i,300i|Alef:400,700|Open+Sans:700,400|Inconsolata" />
<link href="https://www.drzon.net/index.xml" rel="alternate" type="application/rss+xml" title="Code and stuff" />
<meta name="generator" content="Hugo 0.19" />
<link rel="canonical" href="https://www.drzon.net/" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Website",
"publisher": {
"@type": "Person",
"name": ,
"image": {
"@type": "ImageObject",
"url": https://www.drzon.net/images/selfie.png,
"width": 250,
"height": 250
},
"url": https://www.drzon.net,
"sameAs": [
]
},
"url": https://www.drzon.net/,
"mainEntityOfPage": {
"@type": "WebPage",
"@id": https://www.drzon.net/
},
"description":
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44481923-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body class="nav-closed">
<div class="nav">
<h3 class="nav-title">Menu</h3>
<a href="#" class="nav-close">
<span class="hidden">Close</span>
</a>
<ul>
</ul>
<a class="subscribe-button icon-feed" href="https://www.drzon.net/index.xml">Subscribe</a>
</div>
<span class="nav-cover"></span>
<div class="site-wrapper">
<header class="main-header" style="background-image: url(https://www.drzon.net/images/cover.jpg)">
<nav class="main-nav overlay clearfix">
<a class="menu-button" href="https://www.drzon.net/index.xml"><i class="fa fa-rss" aria-hidden="true"></i> Subscribe</a>
</nav>
<div class="vertical">
<div class="main-header-content inner">
<a class="blog-logo" href="https://www.drzon.net/"><img src="https://www.drzon.net/images/selfie.png" alt="Blog Logo" /></a>
<h1 class="page-title">Code and stuff</h1>
<h2 class="page-description"></h2>
<div class="page-social">
<a class="cb-linkedin fa-stack fa-lg" href="https://www.linkedin.com/in/mderazon" title="Michael DeRazon's LinkedIn" target="_blank">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
</a>
<a class="cb-github fa-stack fa-lg" href="https://github.com/mderazon" title="Michael DeRazon's Github" target="_blank">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github-alt fa-stack-1x fa-inverse"></i>
</a>
<a class="cb-twitter fa-stack fa-lg" href="https://twitter.com/mderazon" title="Michael DeRazon's Twitter" target="_blank">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</a>
</div>
</div>
</div>
</header>
<main id="content" class="content" role="main">
<div class="extra-pagination inner">
<nav class="pagination" role="navigation">
<span class="page-number">Page 1 of 1</span>
</nav>
</div>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/automatic-deployments-to-google-cloud-functions-with-travis-ci">Automatic deployment to Google Cloud Functions</a>
</h2>
</header>
<section class='post-excerpt '>
<p>In this post I’ll show you how to achieve a Heroku-like push-to-deploy capability on Google Cloud Functions.
If you don’t know Google Cloud Functions (GCF), it’s a serverless architecture for running services on Google’s services. It’s equivalent to AWS Lambda. You can read about it here.
Goal Pushing any code to the master branch of our Github repository should automatically trigger a deploy of our new code to GCF. <a class="read-more" href="https://www.drzon.net/posts/automatic-deployments-to-google-cloud-functions-with-travis-ci">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/node/">#node</a>,
<a href="https://www.drzon.net/tags/google-cloud-functions/">#google cloud functions</a>,
<a href="https://www.drzon.net/tags/serverless/">#serverless</a>,
<a href="https://www.drzon.net/tags/deployment/">#deployment</a>,
<a href="https://www.drzon.net/tags/paas/">#paas</a>,
<time class="post-date" datetime="2017-04-19T00:00:00Z">
19 Apr 2017
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/generate-random-order-number">Generate a random order-number</a>
</h2>
</header>
<section class='post-excerpt '>
<p>For one of my projects, I needed to generate a random order number that will be sent to customers in an email after they order. Lots of companies do that, it usually looks like this:
Requirements Has to be all digits. Needs to be unique. We don’t want two orders to have the same order number. Has to be random - i.e. not enumerable. We don’t want the orders to be consecutive for example (5001, 5002, 5003, …) so that people can’t guess other orders numbers. <a class="read-more" href="https://www.drzon.net/posts/generate-random-order-number">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/node/">#node</a>,
<a href="https://www.drzon.net/tags/ecommerce/">#ecommerce</a>,
<time class="post-date" datetime="2017-04-16T00:00:00Z">
16 Apr 2017
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/passwordless-login-in-mobile-apps">Passwordless login in mobile apps</a>
</h2>
</header>
<section class='post-excerpt '>
<p>This post touches some problems with traditional email logins in mobile apps and suggests a different approach to handle login without requiring the user to enter any password.
The post is not very technical. Other than occasionally mentioning “client / server” it doesn’t talk about any specific framework / language. Instead, it tries to explain the overall flow and behaviour of passwordless login in mobile apps.
I might add some additional framework specific code examples later but for now it’s mostly ideas. <a class="read-more" href="https://www.drzon.net/posts/passwordless-login-in-mobile-apps">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/mobile-login/">#mobile login</a>,
<a href="https://www.drzon.net/tags/authentication/">#authentication</a>,
<time class="post-date" datetime="2014-10-29T00:00:00Z">
29 Oct 2014
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/export-all-google-sheets-to-csv">Export all Google Sheets to csv</a>
</h2>
</header>
<section class='post-excerpt '>
<p>I had a Google Apps spreadsheet with around 40 sheets. Wanted to export them to csv. Unfortunately Google only lets you export one sheet at a time.
Here’s a script that exports all sheets in a spreadsheet to csv
To use, click on tools –> script editor. Then create a new blank script and paste the code there.
Click on the play button (run) and go back to your spreadsheet. <a class="read-more" href="https://www.drzon.net/posts/export-all-google-sheets-to-csv">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/google-sheets/">#google sheets</a>,
<a href="https://www.drzon.net/tags/csv/">#csv</a>,
<time class="post-date" datetime="2014-03-26T00:00:00Z">
26 Mar 2014
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/approaches-to-json-internationalisation-i18n">Approaches to JSON internationalisation (i18n)</a>
</h2>
</header>
<section class='post-excerpt '>
<p>I needed to create an API that is capable of serving objects with strings in more than one language. Let me present the problem with an example.
Lets assume that we have a web app or a mobile client that wants to get information about coffee shops around the city. Also, lets assume also that we are going to have to support two languages, English and Hebrew (I know, right ? <a class="read-more" href="https://www.drzon.net/posts/approaches-to-json-internationalisation-i18n">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/json/">#json</a>,
<a href="https://www.drzon.net/tags/api/">#api</a>,
<a href="https://www.drzon.net/tags/i18n/">#i18n</a>,
<time class="post-date" datetime="2014-03-23T00:00:00Z">
23 Mar 2014
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/export-mongodb-collections-to-csv-without-specifying-fields">Export mongodb collections to csv without specifying fields</a>
</h2>
</header>
<section class='post-excerpt '>
<p>Sometimes you might want to export your Mongodb database in csv format. If you have many collections, it can be a bit of a hassle since mongoexport requires you to specify each field you want to be exported with the --fields attribute and you have to do it for each collection seperately.
Here’s a little bash script that will do the work for you.
Result is a .csv file for each collection you have in your db. <a class="read-more" href="https://www.drzon.net/posts/export-mongodb-collections-to-csv-without-specifying-fields">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/mongodb/">#mongodb</a>,
<a href="https://www.drzon.net/tags/mongoexport/">#mongoexport</a>,
<a href="https://www.drzon.net/tags/csv/">#csv</a>,
<time class="post-date" datetime="2013-12-31T00:00:00Z">
31 Dec 2013
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/how-to-create-a-clearable-autocomplete-dropdown-with-autocompletetextview">How to create a clearable autocomplete dropdown with AutoCompleteTextView</a>
</h2>
</header>
<section class='post-excerpt '>
<p>I wanted to create a nice search box with autocomplete results dropdown in the ActionBar. I could have used the SearchView widget but I didn’t want to create a searchable activity and all the necessary overhead. Instead I used a more lightweight approach with AutoCompleteTextView. I’ll explain here the steps needed to be done in order to make it work.
My model app was the Gmail app which looks like this : <a class="read-more" href="https://www.drzon.net/posts/how-to-create-a-clearable-autocomplete-dropdown-with-autocompletetextview">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/android/">#android</a>,
<time class="post-date" datetime="2013-11-26T00:00:00Z">
26 Nov 2013
</time>
</footer>
</article>
<article class="post post">
<header class='post-header '>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/i18n-for-node-express">i18n for Node + Express</a>
</h2>
</header>
<section class='post-excerpt '>
<p>In this post i’m going to demonstrate a simple way to add multi language support to a node + express project.
Simple server Lets start with a simple server:
We first require express, then we tell express where to look for our templates files. In this case I used ejs as the template engine. I like it because it’s syntax is basically html with special <% ... %> syntax for embedding code from the server. <a class="read-more" href="https://www.drzon.net/posts/i18n-for-node-express">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/node.js/">#node.js</a>,
<a href="https://www.drzon.net/tags/i18n/">#i18n</a>,
<a href="https://www.drzon.net/tags/express/">#express</a>,
<time class="post-date" datetime="2013-11-26T00:00:00Z">
26 Nov 2013
</time>
</footer>
</article>
<article class="post post">
<header class='post-header rtl'>
<h2 class="post-title">
<a href="https://www.drzon.net/posts/%D7%97%D7%AA%D7%95%D7%A0%D7%94-%D7%90%D7%96%D7%A8%D7%97%D7%99%D7%AA-%D7%91%D7%92%D7%99%D7%91%D7%A8%D7%9C%D7%98%D7%A8">חתונה אזרחית בגיברלטר</a>
</h2>
</header>
<section class='post-excerpt rtl'>
<p>התחתנו כמו רבים וטובים בטקס אזרחי בארץ. תיכננו ירח דבש בספרד ועל הדרך חשבנו שיהיה נחמד להתחתן בגיברלטר כדי שנוכל להירשם בארץ כנשואים.
למה גיברלטר ? נמצא בדרום ספרד, באזור שבו רצינו לטייל. מאד מקלים על התהליך. לא יקר מדיי. טקס באנגלית, פחות בלאגן בתרגום. סה”כ היה קליי קלות, באמת. אז הנה הפרטים. מסמכים דרושים תמצית רישום של כל אחד מבני הזוג ממשרד הפנים להראות שאתם רווקים (אפשר להזמין באינרנט, לוקח בערך שבוע להגיע). <a class="read-more" href="https://www.drzon.net/posts/%D7%97%D7%AA%D7%95%D7%A0%D7%94-%D7%90%D7%96%D7%A8%D7%97%D7%99%D7%AA-%D7%91%D7%92%D7%99%D7%91%D7%A8%D7%9C%D7%98%D7%A8">»</a></p>
</section>
<footer class="post-meta">
<img class="author-thumb" src="https://www.drzon.net/images/selfie.png" alt="Author image" nopin="nopin" />
Michael DeRazon
on
<a href="https://www.drzon.net/tags/civil-wedding/">#civil-wedding</a>,
<a href="https://www.drzon.net/tags/marriage/">#marriage</a>,
<a href="https://www.drzon.net/tags/hebrew/">#hebrew</a>,
<time class="post-date" datetime="2013-11-26T00:00:00Z">
26 Nov 2013
</time>
</footer>
</article>
<nav class="pagination" role="navigation">
<span class="page-number">Page 1 of 1</span>
</nav>
</main>
<footer class="site-footer clearfix">
<section class="copyright"><a href="">Code and stuff</a> All rights reserved - 2017</section>
<section class="poweredby">Proudly generated by <a class="icon-hugo" href="http://gohugo.io">HUGO</a>, hosted on <a class="icon-theme" href="https://github.com/mderazon/blog">Github</a></section>
</footer>
</div>
</body>
</html>