-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
429 lines (345 loc) · 18.9 KB
/
Copy pathindex.html
File metadata and controls
429 lines (345 loc) · 18.9 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>axiac@web</title>
<meta name="author" content="axiac">
<link rel="shortcut icon" href="/images/favicon.png">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1">
<link rel="canonical" href="https://axiac.ro/">
<link rel="alternate" href="/atom.xml" type="application/atom+xml">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0E1JWYSSMS"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-0E1JWYSSMS');
</script>
<script src="/js/modernizr-2.0.js"></script>
<script src="/js/jquery-1.9.1.js"></script>
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));</script>
<link rel="me" href="https://twitter.com/axiac">
<script src="/js/octo.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet"
type="text/css">
<link href="https://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet"
type="text/css">
<link rel="stylesheet" href="/css/octo.css">
<meta property="og:type" content="website">
<meta property="og:title" content="axiac@web">
<meta property="og:url" content="https://axiac.ro/index.html">
<meta property="og:site_name" content="axiac@web">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="axiac">
<meta property="article:tag" content="software development">
<meta property="article:tag" content="application design">
<meta property="article:tag" content="domain model">
<meta property="article:tag" content="oop">
<meta name="twitter:card" content="summary">
<meta name="twitter:creator" content="@axiac">
<meta name="generator" content="Hexo 7.3.0"></head>
<body>
<header role="banner">
<hgroup>
<h1><a href="/">axiac@web</a></h1>
</hgroup>
</header>
<nav role="navigation">
<ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="https://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:https://axiac.ro/">
<input class="search" type="text" name="q" results="0" placeholder="Search">
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/archives">Archives</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title">
<a href="/blog/what-to-mock/">What to Mock?</a>
</h1>
<p class="meta">
<time datetime="2025-05-03T21:00:00.000Z" data-updated="true">Sun May 04 2025</time>
</p>
</header>
<div class="entry-content"><p>Using <a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Test_double">test doubles</a> to replace dependencies in tests has become a standard practice.</p>
<p>Generally, there are three main types of components that should be substituted with test doubles during testing:</p></div>
<footer>
<a rel="full-article" href="/blog/what-to-mock/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/how-to-use-node-env-correctly/">How to Use `NODE_ENV` Correctly</a>
</h1>
<p class="meta">
<time datetime="2025-02-28T22:00:00.000Z" data-updated="true">Sat Mar 01 2025</time>
</p>
</header>
<div class="entry-content"><h2 id="What-is-NODE-ENV"><a href="#What-is-NODE-ENV" class="headerlink" title="What is NODE_ENV?"></a>What is <code>NODE_ENV</code>?</h2><p>The <code>NODE_ENV</code> <a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Environment_variable">environment variable</a> became popular early in Node.js development as a convention to distinguish between runtime environments like development, testing, and production. It is now widely used and supported across many tools and frameworks in the Node.js ecosystem, allowing developers to implement environment-specific configurations and optimizations.</p>
<p>Unfortunatley, many developers don’t grasp its purpose and use it incorrectly.</p></div>
<footer>
<a rel="full-article" href="/blog/how-to-use-node-env-correctly/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/why-is-mysql-time-limited-to-838-59-59/">Why Is MySQL Time Limited to 838:59:59?</a>
</h1>
<p class="meta">
<time datetime="2017-07-27T21:00:00.000Z" data-updated="true">Fri Jul 28 2017</time>
</p>
</header>
<div class="entry-content"><p>An interesting question from <a target="_blank" rel="noopener" href="https://stackoverflow.com/q/39259910/4265352">Stack Overflow</a> asks <em>“Why is MySQL’s maximum time limit 838:59:59?”</em></p>
<p>The official reference at <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/5.7/en/time.html">https://dev.mysql.com/doc/refman/5.7/en/time.html</a> says</p>
<blockquote>
<p><code>TIME</code> values may range from <code>-838:59:59</code> to <code>838:59:59</code>. The hours part may be so large
because the <code>TIME</code> type can be used not only to represent a time of day (which must be
less than 24 hours), but also elapsed time or a time interval between two events
(which may be much greater than 24 hours, or even negative).</p>
</blockquote>
<p>The <code>TIME</code> values were always stored on 3 bytes in MySQL. But the format changed on <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/internals/en/date-and-time-data-type-representation.html">version 5.6.4</a>.</p></div>
<footer>
<a rel="full-article" href="/blog/why-is-mysql-time-limited-to-838-59-59/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/git-ignores-me-not-my-files/">Git Ignores Me, Not My Files</a>
</h1>
<p class="meta">
<time datetime="2017-02-04T22:00:00.000Z" data-updated="true">Sun Feb 05 2017</time>
</p>
</header>
<div class="entry-content"><p>A question that occurs frequently on the Q&A programming sites looks like this:</p>
<blockquote>
<p>I want Git to ignore one of the files in the project. I added the file name and/or the file path to <code>.gitignore</code>
and/or <code>.git/info/exclude</code> but <code>git status</code> still shows the file as being modified.<br>
It seems Git doesn’t ignore the file, it ignores me. I’m desperate, please help!</p>
</blockquote>
<h3 id="Is-it-quite-so-Does-Git-ignore-you"><a href="#Is-it-quite-so-Does-Git-ignore-you" class="headerlink" title="Is it quite so? Does Git ignore you?"></a>Is it quite so? Does Git ignore you?</h3></div>
<footer>
<a rel="full-article" href="/blog/git-ignores-me-not-my-files/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/how-to-merge-composer-files/">How to Merge Composer Files</a>
</h1>
<p class="meta">
<time datetime="2017-01-23T22:00:00.000Z" data-updated="true">Tue Jan 24 2017</time>
</p>
</header>
<div class="entry-content"><p>Resolving the conflicts in <code>composer.json</code> can be done in the usual way: use a <code>diff</code> tool and pull into the
merged file the correct changes from both sides. Save the merged file, add it to the index and you’re good to go.</p>
<p>Regarding a VCS conflict, <code>composer.lock</code> behaves more like a binary file.</div>
<footer>
<a rel="full-article" href="/blog/how-to-merge-composer-files/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/public-properties-are-not-oop/">Public Properties Are Not OOP</a>
</h1>
<p class="meta">
<time datetime="2016-10-15T14:56:57.000Z" data-updated="true">Sat Oct 15 2016</time>
</p>
</header>
<div class="entry-content"><p><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Object-oriented_programming#Encapsulation">Encapsulation</a> is one fundamental concept of object-oriented programming. It refers to
the bundling of data with the methods that operate on that data. Encapsulation is used to hide the values
or state of a structured data object inside a class, preventing unauthorized parties’ direct access to them.</p>
<p>That’s it, the object properties (and some of its methods) should be <code>private</code> (or, sometimes, <code>protected</code>)
and not <code>public</code>.</p></div>
<footer>
<a rel="full-article" href="/blog/public-properties-are-not-oop/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/atlassian-sourcetree-and-git-hooks/">Atlassian SourceTree and Git hooks</a>
</h1>
<p class="meta">
<time datetime="2016-04-18T12:56:40.000Z" data-updated="true">Mon Apr 18 2016</time>
</p>
</header>
<div class="entry-content"><img src="/images/blog/sismo-sourcetree.png" alt="" style="float: right; margin-left: 50px;" />
<p>This article explains how I made <code>Sismo</code> work with Atlassian SourceTree on <code>macOS</code>. First I thought it doesn’t work
out-of-the-box because of a <code>$PATH</code> problem but soon it turned out that the biggest issue comes from the command line
used for integration. Keep reading to learn how I found it out and how easy is to fix it.
<br clear="all" /></p></div>
<footer>
<a rel="full-article" href="/blog/atlassian-sourcetree-and-git-hooks/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/distinct-vs-group-by-with-rollup/">DISTINCT vs. GROUP BY WITH ROLLUP</a>
</h1>
<p class="meta">
<time datetime="2015-04-17T21:00:00.000Z" data-updated="true">Sat Apr 18 2015</time>
</p>
</header>
<div class="entry-content"><h2 id="or-why-2-2-is-not-always-4"><a href="#or-why-2-2-is-not-always-4" class="headerlink" title="or why 2+2 is not always 4"></a>or why 2+2 is not always 4</h2><p><code>WITH ROLLUP</code> is a <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/5.7/en/group-by-modifiers.html"><code>GROUP BY</code> modifier</a> that causes extra rows to be added to
the result set produced by the query. These rows represent higher-level (or super-aggregate)
summary operations.</p>
<p>A shallow examination of the effects of <code>WITH ROLLUP</code> on a query like:</p>
<pre><code>SELECT user_id, COUNT(product) AS nb_products, SUM(amount) AS total FROM cart GROUP BY user_id
</code></pre>
<p>can lead to the erroneous conclusion that the <code>WITH ROLLUP</code> modifier is just a courtesy
of the database implementors to the front-end developers and the extra rows added by it
could be computed on the client-side as well. Big mistake!</p></div>
<footer>
<a rel="full-article" href="/blog/distinct-vs-group-by-with-rollup/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/do-you-clone-the-datetime-objects/">Do You Clone the DateTime Objects?</a>
</h1>
<p class="meta">
<time datetime="2015-02-16T22:00:00.000Z" data-updated="true">Tue Feb 17 2015</time>
</p>
</header>
<div class="entry-content"><p>The <a target="_blank" rel="noopener" href="https://php.net/manual/en/class.datetime.php"><code>DateTime</code></a> class and its friends introduced in PHP 5.2 are a very nice replacement
for the old date & time processing functions (<code>date()</code>, <code>getdate()</code>, <code>strftime()</code>, <code>strtotime()</code> and so on).</p>
<p>But they come with a minor glitch that is hidden in the plain sight: they are objects and as all the other
objects in PHP, they are assigned and passed as parameters by reference<a href="#note-1"><sup>[1]</sup></a> and not as copies.</p>
<p>Most of the time I think of a DateTime as a <code>Value Object</code>, passing it from here to there
without special precautions. And most of the times this works just fine as long as the code doesn’t
try to change it.</p></div>
<footer>
<a rel="full-article" href="/blog/do-you-clone-the-datetime-objects/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title">
<a href="/blog/join-two-git-repositories-and-keep-the-original-commit-dates/">Join two Git repositories and keep the original commit dates</a>
</h1>
<p class="meta">
<time datetime="2014-11-16T22:00:00.000Z" data-updated="true">Mon Nov 17 2014</time>
</p>
</header>
<div class="entry-content"><p>Several years ago I started a project that was stored in a Subversion repository. After
some time, the current (at that time) version of the code was used to create a new Git
repository and the development continued. Several months and hundreds of commits later,
I decided to gather the code from both repositories into a single repository and keep all
the historical data intact.</p>
<p>The goal was to get all the code since the project started until the most recent version
into a single Git repository as we have used Git from the project beginning.</p>
<p>I’ll explain below how to accomplish this goal.</p></div>
<footer>
<a rel="full-article" href="/blog/join-two-git-repositories-and-keep-the-original-commit-dates/">Read on →</a>
</footer>
</article>
<div class="pagination">
<a href="/archives">Blog Archives</a>
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/">Next</a>
</div>
</div>
<aside class="sidebar">
<section class="odd">
<h1>Stack Overflow</h1>
<a target="_blank" rel="noopener" href="https://stackoverflow.com/users/4265352/axiac"><img
src="https://stackoverflow.com/users/flair/4265352.png?theme=clean"
alt="profile for axiac at Stack Overflow, Q&A for professional and enthusiast programmers"
title="profile for axiac at Stack Overflow, Q&A for professional and enthusiast programmers"
width="208" height="58" style="margin-top: 1em" /></a>
</section>
<section class="even">
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li id="gh_loader">Status updating…</li>
</ul>
<a target="_blank" rel="noopener" href="https://github.com/axiac">@axiac</a> on GitHub
<script defer>
const htmlEscaper = document.createElement('textarea');
const target = document.getElementById('gh_repos');
function request () {
const ghUser = 'axiac';
const url = `https://api.github.com/users/${ghUser}/repos?sort=pushed&type=sources`;
return fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
}
function renderError () {
target.classList.add('error');
target.innerText = 'Error loading feed';
}
function renderRepo (repo) {
return `<li>
<a href="${repo.html_url}">${repo.name}</a>
<p>${escapeHTML(repo.description || '')}</p>
</li>`;
}
function escapeHTML (text) {
htmlEscaper.innerHTML = text;
return htmlEscaper.value;
}
request()
.then(response => response.json())
.then(results => {
if (!results) return;
const re = new RegExp('code-golf|adventofcode|maroco|semne-bune' ?? '.*');
const repos = results
.filter(result => !result.fork)
.filter(result => re.test(result.name))
.sort((a, b) => b.stargazers_count - a.stargazers_count)
.reduce((acc, item) => acc.length >= 15 ? acc : [...acc, item], []);
repos.forEach(repo => {
const repoHTML = renderRepo(repo);
target.insertAdjacentHTML('beforeend', repoHTML);
});
document.getElementById('gh_loader').remove();
})
.catch(renderError);
</script>
</section>
</aside>
</div>
</div>
<footer role="contentinfo">
<p>
Copyright © 2013-2025 - axiac -
<span class="credit">Generated using <a target="_blank" rel="noopener" href="https://github.com/jbreckmckye/hexo-theme-octo">Octo theme</a> for <a target="_blank" rel="noopener" href="http://hexo.io">Hexo</a></span>
</p>
</footer>
</body>
</html>