theread.me/site/programming/index.html

198 lines
8.0 KiB
HTML
Raw Normal View History

2022-07-06 17:05:11 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mahdi</title>
<meta name="description" content="a rabbit hole">
<link href="https://fonts.googleapis.com/css?family=Secular+One|Nunito|Mononoki" rel="stylesheet">
<link rel="stylesheet" href="/css/main.css">
<link rel="canonical" href="http://localhost:4000/programming/">
<link rel="alternate" type="application/rss+xml" title="mahdi" href="http://localhost:4000/feed.xml" />
<!--<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>-->
<script>
var channel = new BroadcastChannel('egg');
channel.addEventListener('message', message => {
alert('Got a message from the other tab:\n' + message.data);
});
</script>
</head>
<body>
<header class="site-header">
<h1>
<a class='site-title' href='/'>
mahdi
</a>
</h1>
<nav>
<p>
<a href="/snippets">snippets</a>
<a href="/art">pictures</a>
</p>
<!--<p class='categories'>-->
<!---->
<!---->
<!--<a href="">art</a>-->
<!---->
<!---->
<!---->
<!---->
<!--</p>-->
<p>
<a href='mailto:mdibaiee@pm.me'>email</a>
<a href='https://git.mahdi.blog/mahdi'>git</a>
<a href='https://www.librarything.com/profile/mdibaiee'>librarything</a>
<a href="http://localhost:4000/feed.xml">feed</a>
</p>
</nav>
</header>
<div class="page-content">
<div class="wrapper">
<h1 class="page-heading"></h1>
<div class="category">
<ul class="post-list">
<li>
<h2>
<a class="post-link" href="/rust-box-str-vs-string/">What is `Box<str>` and how is it different from `String` in Rust?</a>
<span class="post-meta">Jun 16, 2022</span>
</h2>
<article class='post-content'>
<p>Today I and a friend went down a rabbit hole about Rust and how it manages the heap when we use <code class="language-plaintext highlighter-rouge">Box</code>, or <code class="language-plaintext highlighter-rouge">String</code>, or <code class="language-plaintext highlighter-rouge">Vec</code>, and while we were at it, I found out there is such a thing as <code class="language-plaintext highlighter-rouge">Box&lt;str&gt;</code>, which might look a bit <em>strange</em> to an untrained eye, since most of the time the <code class="language-plaintext highlighter-rouge">str</code> primitive type is passed around as <code class="language-plaintext highlighter-rouge">&amp;str</code>.</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/typoclassopedia-exercise-solutions/">Typoclassopedia: Exercise solutions</a>
<span class="post-meta">Sep 27, 2017</span>
</h2>
<article class='post-content'>
<p>I wanted to get proficient in Haskell so I decided to follow <a href="http://www.stephendiehl.com/posts/essential_haskell.html">An [Essential] Haskell Reading List</a>. There I stumbled upon <a href="https://wiki.haskell.org/Typeclassopedia">Typoclassopedia</a>, while the material is great, I couldnt find solutions for the exercises to check against, so I decided I would write my own and hopefully the solutions would get fixed in case I have gone wrong by others. So if you think a solution is wrong, let me know in the comments!</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/travis-ci-pr-push/">Difference between Travis CI tests: PR and Push</a>
<span class="post-meta">Sep 9, 2017</span>
</h2>
<article class='post-content'>
<p>I just want to leave this here as I often tend to look it up myself and the first time it was not as easy to figure out.</p>
<p>When using Travis CI along with GitHub (or other git integrations), Travis runs two tests: <code>pr</code> and <code>push</code>.</p>
<p><img src="/img/travis-ci-pr-push-github.jpg" alt="travis-pr-push-github" /></p>
<p>Most of the time you see both tests passing and you do not have to even wonder how they are different, but it has
happened to me that one of the tests fails while the other passes and I started to wonder why.</p>
<h3 id="pr">pr</h3>
<p>The <code>pr</code> test is a test run on the result of a merge between the pull-request branch and the main branch.
As an example, lets say your pull-requests branch is called <code>fix-user-auth</code> and your main branch is <code>master</code>,
in this case, <code>pr</code> merges <code>fix-user-auth</code> into <code>master</code> and then runs the tests on the result of the merge.</p>
<h3 id="push">push</h3>
<p>On the other hand, <code>push</code> is run on the pull-request branch itself, without merging. So in our example above, Travis would checkout to <code>fix-user-auth</code> and run the tests.</p>
<h3 id="a-case-of-difference">A case of difference</h3>
<p>A case in which this difference might be more apparent is when your pull-request is based on a branch other than <code>master</code>, and some changes that your pull-request depends on are missing from <code>master</code>, in this case the <code>push</code> test may pass, but the <code>pr</code> test will fail.</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/open-source-good-bad-ugly/">Open-source: The Good, The Bad and The Ugly</a>
<span class="post-meta">Oct 13, 2015</span>
</h2>
<article class='post-content'>
<p>I have been doing Open-source for a while, I dont call myself an “expert” or something like that,
but Id like to share my opinion and experience on contributing to, and maintaining open-source code.</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/autocomplete-predict-trie/">Autocomplete using Tries</a>
<span class="post-meta">Jul 24, 2015</span>
</h2>
<article class='post-content'>
<p>In this article, Im going over creating an autocompletion/prediction system using a data-structure called Trie, its fast and easy to customize.</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/es7-array-generator-comprehensions/">ES7 Array and Generator comprehensions</a>
<span class="post-meta">Jun 6, 2015</span>
</h2>
<article class='post-content'>
<p>Array comprehension is a new feature proposed for ES7, with a new syntax
to create new arrays from existing <a href="http://www.2ality.com/2015/02/es6-iteration.html">iterables</a>,
comprehensions can replace map and filter.</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/broadcastchannel-api/">BroadcastChannel API</a>
<span class="post-meta">Apr 2, 2015</span>
</h2>
<article class='post-content'>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API">BroadcastChannel API</a>
is a new API used to communicate between same-origin tabs opened by the same user.</p>
</article>
</li>
<li>
<h2>
<a class="post-link" href="/css-filters/">CSS Filters are awesome!</a>
<span class="post-meta">Mar 28, 2015</span>
</h2>
<article class='post-content'>
<p>Ive been working on the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1055181">CSS Filter Editor widget</a> in Firefox Developer Tools for a couple of weeks, thanks to <a href="https://medium.com/@patrickbrosset">Patrick Brosset</a> for mentoring me and <a href="https://github.com/nt1m">Tim Nguyen</a> for his great contributions.</p>
</article>
</li>
</ul>
<p class="rss-subscribe">subscribe <a href="/feed.xml">via rss</a></p>
</div>
</div>
</div>
</body>
</html>