diff options
author | Akshay <[email protected]> | 2020-04-16 16:10:45 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-04-16 16:10:45 +0100 |
commit | ada45c1bea838e5f38f24fe37e558c1b7959ae28 (patch) | |
tree | f163cfc35f2080cc7ff4decdaec0b574e314b3a8 | |
parent | 26af9ac49c3b05151f23ca1087bb06708e97a096 (diff) |
redo pandoc commands to print fragments only
-rw-r--r-- | docs/index.html | 6 | ||||
-rw-r--r-- | docs/index.xml | 1060 | ||||
-rw-r--r-- | docs/posts/WPA_woes/index.html | 31 | ||||
-rw-r--r-- | docs/posts/bash_harder_with_vim/index.html | 31 | ||||
-rw-r--r-- | docs/posts/bye_bye_BDFs/index.html | 31 | ||||
-rw-r--r-- | docs/posts/call_to_ARMs/index.html | 31 | ||||
-rw-r--r-- | docs/posts/color_conundrum/index.html | 31 | ||||
-rw-r--r-- | docs/posts/font_size_fallacies/index.html | 31 | ||||
-rw-r--r-- | docs/posts/get_better_at_yanking_and_putting_in_vim/index.html | 31 | ||||
-rw-r--r-- | docs/posts/hold_position!/index.html | 31 | ||||
-rw-r--r-- | docs/posts/my_setup/index.html | 31 | ||||
-rw-r--r-- | docs/posts/onivim_sucks/index.html | 31 | ||||
-rw-r--r-- | docs/posts/pixel_art_in_GIMP/index.html | 31 | ||||
-rw-r--r-- | docs/posts/rapid_refactoring_with_vim/index.html | 75 | ||||
-rw-r--r-- | docs/posts/static_sites_with_bash/index.html | 75 | ||||
-rw-r--r-- | docs/posts/termux_tandem/index.html | 31 |
16 files changed, 374 insertions, 1214 deletions
diff --git a/docs/index.html b/docs/index.html index 9a5d3bb..02aac35 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -19,7 +19,11 @@ | |||
19 | <div class="post"> | 19 | <div class="post"> |
20 | 20 | ||
21 | <div class=intro> | 21 | <div class=intro> |
22 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 22 | Hi. |
23 | <div class=hot-links> | ||
24 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
25 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
26 | </div> | ||
23 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 27 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
24 | <p> | 28 | <p> |
25 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 29 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/index.xml b/docs/index.xml index c892fb6..1412245 100644 --- a/docs/index.xml +++ b/docs/index.xml | |||
@@ -13,953 +13,435 @@ | |||
13 | <copyright>Creative Commons BY-NC-SA 4.0</copyright> | 13 | <copyright>Creative Commons BY-NC-SA 4.0</copyright> |
14 | <item> | 14 | <item> |
15 | <title>Pixel Art In GIMP</title> | 15 | <title>Pixel Art In GIMP</title> |
16 | <description><p>I've always been an admirer of pixel art, because of it’s | 16 | <description><p>I’ve always been an admirer of pixel art, because of it’s simplicity and it’s resemblance to bitmap font design. Recently, I decided to take the dive and make some art of my own.</p> |
17 | simplicity and it's resemblance to bitmap font design. | 17 | <p>I used GIMP because I am fairly familiar with it. Aseprite seems to be the editor of choice for animated pixel art though.</p> |
18 | Recently, I decided to take the dive and make some art of my | 18 | <h3 id="setting-up-the-canvas">Setting up the canvas</h3> |
19 | own.</p> | 19 | <p>Picking a canvas size is daunting. Too small, and you won’t be able to fit in enough detail to make a legible piece. Too big and you’ve got too many pixels to work with!</p> |
20 | 20 | <p>I would suggest starting out with anywhere between 100x100 and 200x200. <a href="https://u.peppe.rs/u9.png">Here’s</a> a sample configuration.</p> | |
21 | <p>I used GIMP because I am fairly familiar with it. Aseprite | 21 | <p>Sometimes I use a 10x10 grid, <code>View > Show Grid</code> and <code>Edit > Preferences > Default Grid > Spacing</code>, but that can get jarring, so I throw down a couple of guides, drag right or down from the left or top gutters for vertical and horizontal guides respectively.</p> |
22 | seems to be the editor of choice for animated pixel art | 22 | <h3 id="choosing-a-brush">Choosing a Brush</h3> |
23 | though.</p> | 23 | <p>The most important part of our setup is the brush. Use the Pencil Tool (<code>n</code> on the keyboard) for hard edge drawings. Here’s a small comparison if you don’t know the difference between a hard edge and a soft edge:</p> |
24 | 24 | <figure> | |
25 | <h3 id="Setting%20up%20the%20canvas">Setting up the canvas</h3> | 25 | <img src="https://u.peppe.rs/kz.png" alt="" /><figcaption>Hard edge vs Soft Edge</figcaption> |
26 | 26 | </figure> | |
27 | <p>Picking a canvas size is daunting. Too small, and you won’t | 27 | <p>I turn the size down all the way to 1 (<code>[</code> on the keyboard). Set <code>Dynamics</code> off. <a href="https://u.peppe.rs/Fs.png">Here’s</a> a sample brush configuration.</p> |
28 | be able to fit in enough detail to make a legible piece. Too | 28 | <h3 id="laying-down-the-pixels">Laying down the pixels!</h3> |
29 | big and you've got too many pixels to work with!</p> | 29 | <p>With the boring stuff out of the way, we can start with our piece. I usually follow a three step process:</p> |
30 | |||
31 | <p>I would suggest starting out with anywhere between 100x100 | ||
32 | and 200x200. <a href="https://u.peppe.rs/u9.png">Here’s</a> a sample | ||
33 | configuration. </p> | ||
34 | |||
35 | <p>Sometimes I use a 10x10 grid, <code>View > Show Grid</code> and <code>Edit > | ||
36 | Preferences > Default Grid > Spacing</code>, but that can get | ||
37 | jarring, so I throw down a couple of guides, drag right or | ||
38 | down from the left or top gutters for vertical and | ||
39 | horizontal guides respectively.</p> | ||
40 | |||
41 | <h3 id="Choosing%20a%20Brush">Choosing a Brush</h3> | ||
42 | |||
43 | <p>The most important part of our setup is the brush. Use the | ||
44 | Pencil Tool (<code>n</code> on the keyboard) for hard edge drawings. | ||
45 | Here's a small comparison if you don't know the difference | ||
46 | between a hard edge and a soft edge:</p> | ||
47 | |||
48 | <p><img src="https://u.peppe.rs/kz.png" alt="Hard edge vs Soft Edge" /></p> | ||
49 | |||
50 | <p>I turn the size down all the way to 1 (<code>[</code> on the keyboard). | ||
51 | Set <code>Dynamics</code> off. <a href="https://u.peppe.rs/Fs.png">Here’s</a> a | ||
52 | sample brush configuration.</p> | ||
53 | |||
54 | <h3 id="Laying%20down%20the%20pixels!">Laying down the pixels!</h3> | ||
55 | |||
56 | <p>With the boring stuff out of the way, we can start with our | ||
57 | piece. I usually follow a three step process:</p> | ||
58 | |||
59 | <ul> | 30 | <ul> |
60 | <li>draw a rough outline</li> | 31 | <li>draw a rough outline</li> |
61 | <li>fill in the shadows</li> | 32 | <li>fill in the shadows</li> |
62 | <li>add highlights</li> | 33 | <li>add highlights</li> |
63 | </ul> | 34 | </ul> |
64 | 35 | <p>But this process is better explained with an example: an onigiri. Let us start off with a 100x100 canvas.</p> | |
65 | <p>But this process is better explained with an example: an | 36 | <h4 id="drawing-the-outline">Drawing the outline</h4> |
66 | onigiri. Let us start off with a 100x100 canvas.</p> | 37 | <p>For the most part, our figure will be symmetric. If you are on GIMP 2.10+, you can take advantage of the Symmetry Painting feature. Go ahead and enable vertical symmetry, <code>Window > Dockable Dialogs > Symmetry Painting</code> and <code>Symmetry Painting > Symmetry > Mirror > Vertical</code>.</p> |
67 | 38 | <p>If you are running an older version of GIMP, draw in the left side, duplicate the layer, flip it horizontally, and merge it with the original.</p> | |
68 | <h4 id="Drawing%20the%20outline">Drawing the outline</h4> | ||
69 | |||
70 | <p>For the most part, our figure will be symmetric. If you are | ||
71 | on GIMP 2.10+, you can take advantage of the Symmetry | ||
72 | Painting feature. Go ahead and enable vertical symmetry, | ||
73 | <code>Window > Dockable Dialogs > Symmetry Painting</code> and | ||
74 | <code>Symmetry Painting > Symmetry > Mirror > Vertical</code>. </p> | ||
75 | |||
76 | <p>If you are running an older version of GIMP, draw in the | ||
77 | left side, duplicate the layer, flip it horizontally, and | ||
78 | merge it with the original.</p> | ||
79 | |||
80 | <p>Your outline might look something like this:</p> | 39 | <p>Your outline might look something like this:</p> |
81 | 40 | <p><img src="https://u.peppe.rs/mn.png" /></p> | |
82 | <p><img src="https://u.peppe.rs/mn.png" alt="" /></p> | 41 | <p>Go ahead and fill it in with the fill tool (<code>Shift + b</code> on the keyboard), add in some seaweed as well, preferably on a different layer. You can toggle symmetry on and off to save yourself some time.</p> |
83 | 42 | <p><img src="https://u.peppe.rs/xu.png" /></p> | |
84 | <p>Go ahead and fill it in with the fill tool (<code>Shift + b</code> on | 43 | <h4 id="shadows">Shadows</h4> |
85 | the keyboard), add in some seaweed as well, preferably on a | 44 | <p>For now, let us focus on the shadows on the object itself, we’ll come back to the shadows cast by the object on the surface later.</p> |
86 | different layer. You can toggle symmetry on and off to save | 45 | <p>Shadows on any surface always follow the shape of the surface. A spherical onigiri would have a circular shadow:</p> |
87 | yourself some time.</p> | 46 | <p><img src="https://u.peppe.rs/FU.png" /></p> |
88 | |||
89 | <p><img src="https://u.peppe.rs/xu.png" alt="" /></p> | ||
90 | |||
91 | <h4 id="Shadows">Shadows</h4> | ||
92 | |||
93 | <p>For now, let us focus on the shadows on the object itself, | ||
94 | we'll come back to the shadows cast by the object on the | ||
95 | surface later.</p> | ||
96 | |||
97 | <p>Shadows on any surface always follow the shape of the | ||
98 | surface. A spherical onigiri would have a circular shadow:</p> | ||
99 | |||
100 | <p><img src="https://u.peppe.rs/FU.png" alt="" /></p> | ||
101 | |||
102 | <p>A couple of noticeable changes:</p> | 47 | <p>A couple of noticeable changes:</p> |
103 | 48 | <p><strong>Layers</strong>: The layer containing the seaweed has been hidden.<br /> | |
104 | <p><strong>Layers</strong>: The layer containing the seaweed has been hidden.<br/> | 49 | <strong>Color</strong>: The color of the shadow is just a slightly lighter version of the original object (reduce the Value on the HSV scale).<br /> |
105 | <strong>Color</strong>: The color of the shadow is just a slightly | 50 | <strong>Area</strong>: The shadow does not go all the way (notice the bottom edges).</p> |
106 | lighter version of the original object (reduce the Value on | 51 | <p>The shadow does not go all the way because we will be filling in that area with another, darker shadow! An image might explain better:</p> |
107 | the HSV scale).<br/> | 52 | <p><img src="https://u.peppe.rs/Br.png" /></p> |
108 | <strong>Area</strong>: The shadow does not go all the way (notice the bottom | 53 | <p>To emulate soft lights, reduce the value by 2 to 3 points every iteration. Notice how area <code>1</code> is much larger than area <code>4</code>. This is because an onigiri resembles a bottom heavy oblate spheroid, a sphere that is slightly fatter around the lower bottom, and areas <code>1</code> and <code>2</code> catch more light than areas <code>3</code> and <code>4</code>.</p> |
109 | edges). </p> | 54 | <p>Do the same with the seaweed. The seaweed, being a smaller, flatter object, doesn’t cast much of a shadow, so stop with 1 or 2 iterations of the gradient:</p> |
110 | 55 | <p><img src="https://u.peppe.rs/T3.png" /></p> | |
111 | <p>The shadow does not go all the way because we will be | 56 | <p>We’re getting there!</p> |
112 | filling in that area with another, darker shadow! An image | 57 | <h4 id="highlights">Highlights</h4> |
113 | might explain better:</p> | 58 | <p>This step handles the details on the strongly illuminated portions of the object. Seaweed is a bit glossy, lighten the edges to make it seem shiny. The rice is not as shiny, but it does form an uneven surface. Add in some shadows to promote the idea of rice grains. Here is the finished result:</p> |
114 | 59 | <p><img src="https://u.peppe.rs/VE.png" /></p> | |
115 | <p><img src="https://u.peppe.rs/Br.png" alt="" /></p> | 60 | <h3 id="finishing-touches">Finishing Touches</h3> |
116 | 61 | <p>Some color correction and <code>a e s t h e t i c</code> Japanese text later, our piece is complete!</p> | |
117 | <p>To emulate soft lights, reduce the value by 2 to 3 points | 62 | <p><img src="https://u.peppe.rs/cn.png" /></p> |
118 | every iteration. Notice how area <code>1</code> is much larger than | 63 | <p>Hold on, why is it so tiny? Well, that’s because our canvas was 100x100, head over to <code>Image > Scale Image</code>, set <code>Quality > Interpolation</code> to <code>None</code> and scale it up to 700x700, et voilà!</p> |
119 | area <code>4</code>. This is because an onigiri resembles a bottom | 64 | <p><img src="https://u.peppe.rs/CH.png" /></p></description> |
120 | heavy oblate spheroid, a sphere that is slightly fatter | ||
121 | around the lower bottom, and areas <code>1</code> and <code>2</code> catch more | ||
122 | light than areas <code>3</code> and <code>4</code>.</p> | ||
123 | |||
124 | <p>Do the same with the seaweed. The seaweed, being a smaller, | ||
125 | flatter object, doesn't cast much of a shadow, so stop with | ||
126 | 1 or 2 iterations of the gradient:</p> | ||
127 | |||
128 | <p><img src="https://u.peppe.rs/T3.png" alt="" /></p> | ||
129 | |||
130 | <p>We're getting there!</p> | ||
131 | |||
132 | <h4 id="Highlights">Highlights</h4> | ||
133 | |||
134 | <p>This step handles the details on the strongly illuminated | ||
135 | portions of the object. Seaweed is a bit glossy, lighten the | ||
136 | edges to make it seem shiny. The rice is not as shiny, but | ||
137 | it does form an uneven surface. Add in some shadows to | ||
138 | promote the idea of rice grains. Here is the finished | ||
139 | result:</p> | ||
140 | |||
141 | <p><img src="https://u.peppe.rs/VE.png" alt="" /></p> | ||
142 | |||
143 | <h3 id="Finishing%20Touches">Finishing Touches</h3> | ||
144 | |||
145 | <p>Some color correction and <code>a e s t h e t i c</code> Japanese text | ||
146 | later, our piece is complete!</p> | ||
147 | |||
148 | <p><img src="https://u.peppe.rs/cn.png" alt="" /></p> | ||
149 | |||
150 | <p>Hold on, why is it so tiny? Well, that's because our canvas | ||
151 | was 100x100, head over to <code>Image > Scale Image</code>, set | ||
152 | <code>Quality > Interpolation</code> to <code>None</code> and scale it up to | ||
153 | 700x700, et voilà!</p> | ||
154 | |||
155 | <p><img src="https://u.peppe.rs/CH.png" alt="" /></p></description> | ||
156 | <link>https://peppe.rs/posts/pixel_art_in_GIMP/</link> | 65 | <link>https://peppe.rs/posts/pixel_art_in_GIMP/</link> |
157 | <pubDate>Thu, 09 Apr 2020 16:28:00 +0000</pubDate> | 66 | <pubDate>Thu, 09 Apr 2020 16:28:00 +0000</pubDate> |
158 | <guid>https://peppe.rs/posts/pixel_art_in_GIMP/</guid> | 67 | <guid>https://peppe.rs/posts/pixel_art_in_GIMP/</guid> |
159 | </item> | 68 | </item> |
160 | <item> | 69 | <item> |
161 | <title>Rapid Refactoring With Vim</title> | 70 | <title>Rapid Refactoring With Vim</title> |
162 | <description><p>Last weekend, I was tasked with refactoring the 96 unit | 71 | <description><p>Last weekend, I was tasked with refactoring the 96 unit tests on <a href="https://github.com/ruma/ruma-events/pull/70">ruma-events</a> to use strictly typed json objects using <code>serde_json::json!</code> instead of raw strings. It was rather painless thanks to vim :)</p> |
163 | tests on | 72 | <p>Here’s a small sample of what had to be done (note the lines prefixed with the arrow):</p> |
164 | <a href="https://github.com/ruma/ruma-events/pull/70">ruma-events</a> | 73 | <div class="sourceCode" id="cb1"><pre class="sourceCode rust"><code class="sourceCode rust"><span id="cb1-1"><a href="#cb1-1"></a>→ <span class="kw">use</span> <span class="pp">serde_json::</span><span class="op">{</span>from_str<span class="op">};</span></span> |
165 | to use strictly typed json objects using <code>serde_json::json!</code> | 74 | <span id="cb1-2"><a href="#cb1-2"></a> </span> |
166 | instead of raw strings. It was rather painless thanks to | 75 | <span id="cb1-3"><a href="#cb1-3"></a> <span class="at">#[</span>test<span class="at">]</span></span> |
167 | vim :)</p> | 76 | <span id="cb1-4"><a href="#cb1-4"></a> <span class="kw">fn</span> deserialize() <span class="op">{</span></span> |
168 | 77 | <span id="cb1-5"><a href="#cb1-5"></a> <span class="pp">assert_eq!</span>(</span> | |
169 | <p>Here's a small sample of what had to be done (note the lines | 78 | <span id="cb1-6"><a href="#cb1-6"></a>→ <span class="pp">from_str::</span><span class="op"><</span>Action<span class="op">></span>(<span class="st">r#"{"set_tweak": "highlight"}"#</span>)<span class="op">,</span></span> |
170 | prefixed with the arrow):</p> | 79 | <span id="cb1-7"><a href="#cb1-7"></a> <span class="pp">Action::</span>SetTweak(<span class="pp">Tweak::</span>Highlight <span class="op">{</span> value<span class="op">:</span> <span class="cn">true</span> <span class="op">}</span>)</span> |
171 | 80 | <span id="cb1-8"><a href="#cb1-8"></a> )<span class="op">;</span></span> | |
172 | <pre><code class="language-rust">→ use serde_json::{from_str}; | 81 | <span id="cb1-9"><a href="#cb1-9"></a> <span class="op">}</span></span></code></pre></div> |
173 | |||
174 | #[test] | ||
175 | fn deserialize() { | ||
176 | assert_eq!( | ||
177 | → from_str::<Action>(r#"{"set_tweak": "highlight"}"#), | ||
178 | Action::SetTweak(Tweak::Highlight { value: true }) | ||
179 | ); | ||
180 | } | ||
181 | </code></pre> | ||
182 | |||
183 | <p>had to be converted to:</p> | 82 | <p>had to be converted to:</p> |
184 | 83 | <div class="sourceCode" id="cb2"><pre class="sourceCode rust"><code class="sourceCode rust"><span id="cb2-1"><a href="#cb2-1"></a>→ <span class="kw">use</span> <span class="pp">serde_json::</span><span class="op">{</span>from_value<span class="op">};</span></span> | |
185 | <pre><code class="language-rust">→ use serde_json::{from_value}; | 84 | <span id="cb2-2"><a href="#cb2-2"></a> </span> |
186 | 85 | <span id="cb2-3"><a href="#cb2-3"></a> <span class="at">#[</span>test<span class="at">]</span></span> | |
187 | #[test] | 86 | <span id="cb2-4"><a href="#cb2-4"></a> <span class="kw">fn</span> deserialize() <span class="op">{</span></span> |
188 | fn deserialize() { | 87 | <span id="cb2-5"><a href="#cb2-5"></a> <span class="pp">assert_eq!</span>(</span> |
189 | assert_eq!( | 88 | <span id="cb2-6"><a href="#cb2-6"></a>→ <span class="pp">from_value::</span><span class="op"><</span>Action<span class="op">></span>(<span class="pp">json!</span>(<span class="op">{</span><span class="st">"set_tweak"</span><span class="op">:</span> <span class="st">"highlight"</span><span class="op">}</span>))<span class="op">,</span></span> |
190 | → from_value::<Action>(json!({"set_tweak": "highlight"})), | 89 | <span id="cb2-7"><a href="#cb2-7"></a> <span class="pp">Action::</span>SetTweak(<span class="pp">Tweak::</span>Highlight <span class="op">{</span> value<span class="op">:</span> <span class="cn">true</span> <span class="op">}</span>)</span> |
191 | Action::SetTweak(Tweak::Highlight { value: true }) | 90 | <span id="cb2-8"><a href="#cb2-8"></a> )<span class="op">;</span></span> |
192 | ); | 91 | <span id="cb2-9"><a href="#cb2-9"></a> <span class="op">}</span></span></code></pre></div> |
193 | } | 92 | <h3 id="the-arglist">The arglist</h3> |
194 | </code></pre> | 93 | <p>For the initial pass, I decided to handle imports, this was a simple find and replace operation, done to all the files containing tests. Luckily, modules (and therefore files) containing tests in Rust are annotated with the <code>#[cfg(test)]</code> attribute. I opened all such files:</p> |
195 | 94 | <div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1"></a><span class="co"># `grep -l pattern files` lists all the files</span></span> | |
196 | <h3 id="The%20arglist">The arglist</h3> | 95 | <span id="cb3-2"><a href="#cb3-2"></a><span class="co"># matching the pattern</span></span> |
197 | 96 | <span id="cb3-3"><a href="#cb3-3"></a></span> | |
198 | <p>For the initial pass, I decided to handle imports, this was | 97 | <span id="cb3-4"><a href="#cb3-4"></a><span class="ex">vim</span> <span class="va">$(</span><span class="fu">grep</span> -l <span class="st">'cfg\(test\)'</span> ./**/*.rs<span class="va">)</span></span> |
199 | a simple find and replace operation, done to all the files | 98 | <span id="cb3-5"><a href="#cb3-5"></a></span> |
200 | containing tests. Luckily, modules (and therefore files) | 99 | <span id="cb3-6"><a href="#cb3-6"></a><span class="co"># expands to something like:</span></span> |
201 | containing tests in Rust are annotated with the | 100 | <span id="cb3-7"><a href="#cb3-7"></a><span class="ex">vim</span> push_rules.rs room/member.rs key/verification/lib.rs</span></code></pre></div> |
202 | <code>#[cfg(test)]</code> attribute. I opened all such files:</p> | 101 | <p>Starting vim with more than one file at the shell prompt populates the arglist. Hit <code>:args</code> to see the list of files currently ready to edit. The square [brackets] indicate the current file. Navigate through the arglist with <code>:next</code> and <code>:prev</code>. I use tpope’s vim-unimpaired <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, which adds <code>]a</code> and <code>[a</code>, mapped to <code>:next</code> and <code>:prev</code>.</p> |
203 | 102 | <p>All that’s left to do is the find and replace, for which we will be using vim’s <code>argdo</code>, applying a substitution to every file in the arglist:</p> | |
204 | <pre><code class="language-bash"># `grep -l pattern files` lists all the files | 103 | <pre><code>:argdo s/from_str/from_value/g</code></pre> |
205 | # matching the pattern | 104 | <h3 id="the-quickfix-list">The quickfix list</h3> |
206 | 105 | <p>Next up, replacing <code>r#" ... "#</code> with <code>json!( ... )</code>. I couldn’t search and replace that trivially, so I went with a macro call <a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a> instead, starting with the cursor on ‘r’, represented by the caret, in my attempt to breakdown the process:</p> | |
207 | vim $(grep -l 'cfg\(test\)' ./**/*.rs) | 106 | <pre><code>BUFFER: r#" ... "#; |
208 | |||
209 | # expands to something like: | ||
210 | vim push_rules.rs room/member.rs key/verification/lib.rs | ||
211 | </code></pre> | ||
212 | |||
213 | <p>Starting vim with more than one file at the shell prompt | ||
214 | populates the arglist. Hit <code>:args</code> to see the list of | ||
215 | files currently ready to edit. The square [brackets] | ||
216 | indicate the current file. Navigate through the arglist | ||
217 | with <code>:next</code> and <code>:prev</code>. I use tpope's vim-unimpaired | ||
218 | <sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup>, which adds <code>]a</code> and <code>[a</code>, mapped to <code>:next</code> and | ||
219 | <code>:prev</code>.</p> | ||
220 | |||
221 | <p>All that's left to do is the find and replace, for which we | ||
222 | will be using vim's <code>argdo</code>, applying a substitution to | ||
223 | every file in the arglist:</p> | ||
224 | |||
225 | <pre><code>:argdo s/from_str/from_value/g | ||
226 | </code></pre> | ||
227 | |||
228 | <h3 id="The%20quickfix%20list">The quickfix list</h3> | ||
229 | |||
230 | <p>Next up, replacing <code>r#" ... "#</code> with <code>json!( ... )</code>. I | ||
231 | couldn't search and replace that trivially, so I went with a | ||
232 | macro call <sup id="fnref2"><a href="#fn2" rel="footnote">2</a></sup> instead, starting with the cursor on | ||
233 | ‘r’, represented by the caret, in my attempt to breakdown | ||
234 | the process:</p> | ||
235 | |||
236 | <pre><code>BUFFER: r#" ... "#; | ||
237 | ^ | 107 | ^ |
238 | 108 | ||
239 | ACTION: vllsjson!( | 109 | ACTION: vllsjson!( |
240 | 110 | ||
241 | BUFFER json!( ... "#; | 111 | BUFFER json!( ... "#; |
242 | ^ | 112 | ^ |
243 | 113 | ||
244 | ACTION: <esc>$F# | 114 | ACTION: <esc>$F# |
245 | 115 | ||
246 | BUFFER: json!( ... "#; | 116 | BUFFER: json!( ... "#; |
247 | ^ | 117 | ^ |
248 | 118 | ||
249 | ACTION: vhs)<esc> | 119 | ACTION: vhs)<esc> |
250 | |||
251 | BUFFER: json!( ... ); | ||
252 | </code></pre> | ||
253 | |||
254 | <p>Here's the recorded <sup id="fnref3"><a href="#fn3" rel="footnote">3</a></sup> macro in all its glory: | ||
255 | <code>vllsjson!(<esc>$F#vhs)<esc></code>. </p> | ||
256 | |||
257 | <p>Great! So now we just go ahead, find every occurrence of | ||
258 | <code>r#</code> and apply the macro right? Unfortunately, there were | ||
259 | more than a few occurrences of raw strings that had to stay | ||
260 | raw strings. Enter, the quickfix list.</p> | ||
261 | |||
262 | <p>The idea behind the quickfix list is to jump from one | ||
263 | position in a file to another (maybe in a different file), | ||
264 | much like how the arglist lets you jump from one file to | ||
265 | another.</p> | ||
266 | |||
267 | <p>One of the easiest ways to populate this list with a bunch | ||
268 | of positions is to use <code>vimgrep</code>:</p> | ||
269 | 120 | ||
121 | BUFFER: json!( ... );</code></pre> | ||
122 | <p>Here’s the recorded <a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"><sup>3</sup></a> macro in all its glory: <code>vllsjson!(<esc>$F#vhs)<esc></code>.</p> | ||
123 | <p>Great! So now we just go ahead, find every occurrence of <code>r#</code> and apply the macro right? Unfortunately, there were more than a few occurrences of raw strings that had to stay raw strings. Enter, the quickfix list.</p> | ||
124 | <p>The idea behind the quickfix list is to jump from one position in a file to another (maybe in a different file), much like how the arglist lets you jump from one file to another.</p> | ||
125 | <p>One of the easiest ways to populate this list with a bunch of positions is to use <code>vimgrep</code>:</p> | ||
270 | <pre><code># basic usage | 126 | <pre><code># basic usage |
271 | :vimgrep pattern files | 127 | :vimgrep pattern files |
272 | 128 | ||
273 | # search for raw strings | 129 | # search for raw strings |
274 | :vimgrep 'r#' ./**/*.rs | 130 | :vimgrep 'r#' ./**/*.rs</code></pre> |
275 | </code></pre> | 131 | <p>Like <code>:next</code> and <code>:prev</code>, you can navigate the quickfix list with <code>:cnext</code> and <code>:cprev</code>. Every time you move up or down the list, vim indicates your index:</p> |
276 | 132 | <pre><code>(1 of 131): r#"{"set_tweak": "highlight"}"#;</code></pre> | |
277 | <p>Like <code>:next</code> and <code>:prev</code>, you can navigate the quickfix list | 133 | <p>And just like <code>argdo</code>, you can <code>cdo</code> to apply commands to <em>every</em> match in the quickfix list:</p> |
278 | with <code>:cnext</code> and <code>:cprev</code>. Every time you move up or down | 134 | <pre><code>:cdo norm! @q</code></pre> |
279 | the list, vim indicates your index:</p> | 135 | <p>But, I had to manually pick out matches, and it involved some button mashing.</p> |
280 | 136 | <h3 id="external-filtering">External Filtering</h3> | |
281 | <pre><code>(1 of 131): r#"{"set_tweak": "highlight"}"#; | 137 | <p>Some code reviews later, I was asked to format all the json inside the <code>json!</code> macro. All you have to do is pass a visual selection through a pretty json printer. Select the range to be formatted in visual mode, and hit <code>:</code>, you will notice the command line displaying what seems to be gibberish:</p> |
282 | </code></pre> | 138 | <pre><code>:'<,'></code></pre> |
283 | 139 | <p><code>'<</code> and <code>'></code> are <em>marks</em> <a href="#fn4" class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a>. More specifically, they are marks that vim sets automatically every time you make a visual selection, denoting the start and end of the selection.</p> | |
284 | <p>And just like <code>argdo</code>, you can <code>cdo</code> to apply commands to | ||
285 | <em>every</em> match in the quickfix list:</p> | ||
286 | |||
287 | <pre><code>:cdo norm! @q | ||
288 | </code></pre> | ||
289 | |||
290 | <p>But, I had to manually pick out matches, and it involved | ||
291 | some button mashing.</p> | ||
292 | |||
293 | <h3 id="External%20Filtering">External Filtering</h3> | ||
294 | |||
295 | <p>Some code reviews later, I was asked to format all the json | ||
296 | inside the <code>json!</code> macro. All you have to do is pass a | ||
297 | visual selection through a pretty json printer. Select the | ||
298 | range to be formatted in visual mode, and hit <code>:</code>, you will | ||
299 | notice the command line displaying what seems to be | ||
300 | gibberish:</p> | ||
301 | |||
302 | <pre><code>:'<,'> | ||
303 | </code></pre> | ||
304 | |||
305 | <p><code>'<</code> and <code>'></code> are <em>marks</em> <sup id="fnref4"><a href="#fn4" rel="footnote">4</a></sup>. More | ||
306 | specifically, they are marks that vim sets automatically | ||
307 | every time you make a visual selection, denoting the start | ||
308 | and end of the selection.</p> | ||
309 | |||
310 | <p>A range is one or more line specifiers separated by a <code>,</code>:</p> | 140 | <p>A range is one or more line specifiers separated by a <code>,</code>:</p> |
311 | |||
312 | <pre><code>:1,7 lines 1 through 7 | 141 | <pre><code>:1,7 lines 1 through 7 |
313 | :32 just line 32 | 142 | :32 just line 32 |
314 | :. the current line | 143 | :. the current line |
315 | :.,$ the current line to the last line | 144 | :.,$ the current line to the last line |
316 | :'a,'b mark 'a' to mark 'b' | 145 | :'a,'b mark 'a' to mark 'b'</code></pre> |
317 | </code></pre> | 146 | <p>Most <code>:</code> commands can be prefixed by ranges. <code>:help usr_10.txt</code> for more on that.</p> |
318 | 147 | <p>Alright, lets pass json through <code>python -m json.tool</code>, a json formatter that accepts <code>stdin</code> (note the use of <code>!</code> to make use of an external program):</p> | |
319 | <p>Most <code>:</code> commands can be prefixed by ranges. <code>:help | 148 | <pre><code>:'<,'>!python -m json.tool</code></pre> |
320 | usr_10.txt</code> for more on that.</p> | 149 | <p>Unfortunately that didn’t quite work for me because the range included some non-json text as well, a mix of regex and macros helped fix that. I think you get the drift.</p> |
321 | 150 | <p>Another fun filter I use from time to time is <code>:!sort</code>, to sort css attributes, or <code>:!uniq</code> to remove repeated imports.</p> | |
322 | <p>Alright, lets pass json through <code>python -m json.tool</code>, a | 151 | <section class="footnotes" role="doc-endnotes"> |
323 | json formatter that accepts <code>stdin</code> (note the use of <code>!</code> to | 152 | <hr /> |
324 | make use of an external program):</p> | ||
325 | |||
326 | <pre><code>:'<,'>!python -m json.tool | ||
327 | </code></pre> | ||
328 | |||
329 | <p>Unfortunately that didn't quite work for me because the | ||
330 | range included some non-json text as well, a mix of regex | ||
331 | and macros helped fix that. I think you get the drift.</p> | ||
332 | |||
333 | <p>Another fun filter I use from time to time is <code>:!sort</code>, to | ||
334 | sort css attributes, or <code>:!uniq</code> to remove repeated imports.</p> | ||
335 | |||
336 | <div class="footnotes"> | ||
337 | <hr/> | ||
338 | <ol> | 153 | <ol> |
339 | 154 | <li id="fn1" role="doc-endnote"><p>https://github.com/tpope/vim-unimpaired It also handles various other mappings, <code>]q</code> and <code>[q</code> to navigate the quickfix list for example<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | |
340 | <li id="fn1"> | 155 | <li id="fn2" role="doc-endnote"><p><code>:help recording</code><a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
341 | <p><a href="https://github.com/tpope/vim-unimpaired">https://github.com/tpope/vim-unimpaired</a> | 156 | <li id="fn3" role="doc-endnote"><p>When I’m recording a macro, I prefer starting out by storing it in register <code>q</code>, and then copying it over to another register if it works as intended. I think of <code>qq</code> as ‘quick record’.<a href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
342 | It also handles various other mappings, <code>]q</code> and <code>[q</code> to | 157 | <li id="fn4" role="doc-endnote"><p><code>:help mark-motions</code><a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
343 | navigate the quickfix list for example <a href="#fnref1" rev="footnote">↩</a></p> | ||
344 | </li> | ||
345 | |||
346 | <li id="fn2"> | ||
347 | <p><code>:help recording</code> <a href="#fnref2" rev="footnote">↩</a></p> | ||
348 | </li> | ||
349 | |||
350 | <li id="fn3"> | ||
351 | <p>When I'm recording a macro, I prefer starting out by | ||
352 | storing it in register <code>q</code>, and then copying it over to | ||
353 | another register if it works as intended. I think of <code>qq</code> as | ||
354 | ‘quick record’. <a href="#fnref3" rev="footnote">↩</a></p> | ||
355 | </li> | ||
356 | |||
357 | <li id="fn4"> | ||
358 | <p><code>:help mark-motions</code> <a href="#fnref4" rev="footnote">↩</a></p> | ||
359 | </li> | ||
360 | |||
361 | </ol> | 158 | </ol> |
362 | </div></description> | 159 | </section></description> |
363 | <link>https://peppe.rs/posts/rapid_refactoring_with_vim/</link> | 160 | <link>https://peppe.rs/posts/rapid_refactoring_with_vim/</link> |
364 | <pubDate>Wed, 01 Apr 2020 06:29:00 +0000</pubDate> | 161 | <pubDate>Wed, 01 Apr 2020 06:29:00 +0000</pubDate> |
365 | <guid>https://peppe.rs/posts/rapid_refactoring_with_vim/</guid> | 162 | <guid>https://peppe.rs/posts/rapid_refactoring_with_vim/</guid> |
366 | </item> | 163 | </item> |
367 | <item> | 164 | <item> |
368 | <title>Font Size Fallacies</title> | 165 | <title>Font Size Fallacies</title> |
369 | <description><p>I am not an expert with fonts, but I do have some | 166 | <description><p>I am not an expert with fonts, but I do have some experience <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, and common sense. This post aims to debunk some misconceptions about font sizes!</p> |
370 | experience <sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup>, and common sense. This post aims to debunk some | 167 | <p>11 px on your display is <em>probably not</em> 11 px on my display. Let’s do some quick math. I have two displays, 1366x768 @ 21" and another with 1920x1080 @ 13", call them <code>A</code> and <code>B</code> for now.</p> |
371 | misconceptions about font sizes!</p> | 168 | <p>Display <code>A</code> has 1,049,088 pixels. A pixel is a square, of side say, <code>s</code> cm. The total area covered by my 21" display is about 1,066 cm^2 (41x26). Thus,</p> |
372 | |||
373 | <p>11 px on your display is <em>probably not</em> 11 px on my display. | ||
374 | Let's do some quick math. I have two displays, 1366x768 @ | ||
375 | 21” and another with 1920x1080 @ 13”, call them <code>A</code> and | ||
376 | <code>B</code> for now.</p> | ||
377 | |||
378 | <p>Display <code>A</code> has 1,049,088 pixels. A pixel is a square, of | ||
379 | side say, <code>s</code> cm. The total area covered by my 21” display | ||
380 | is about 1,066 cm<sup>2</sup> (41x26). Thus,</p> | ||
381 | |||
382 | <pre><code>Display A | 169 | <pre><code>Display A |
383 | Dimensions: 1366x768 @ 21" (41x26 sq. cm) | 170 | Dimensions: 1366x768 @ 21" (41x26 sq. cm) |
384 | 1,049,088 s^2 = 1066 | 171 | 1,049,088 s^2 = 1066 |
385 | s = 0.0318 cm (side of a pixel on Display A) | 172 | s = 0.0318 cm (side of a pixel on Display A)</code></pre> |
386 | </code></pre> | 173 | <p>Bear with me, as I repeat the number crunching for Display <code>B</code>:</p> |
387 | |||
388 | <p>Bear with me, as I repeat the number crunching for Display | ||
389 | <code>B</code>:</p> | ||
390 | |||
391 | <pre><code>Display B | 174 | <pre><code>Display B |
392 | Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm) | 175 | Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm) |
393 | 2,073,600 s^2 = 486.75 | 176 | 2,073,600 s^2 = 486.75 |
394 | s = 0.0153 cm (side of a pixel on Display B) | 177 | s = 0.0153 cm (side of a pixel on Display B)</code></pre> |
395 | </code></pre> | 178 | <p>The width of a pixel on Display <code>A</code> is <em>double</em> the width of a pixel on Display <code>B</code>. The area occupied by a pixel on Display <code>A</code> is <em>4 times</em> the area occupied by a pixel on Display <code>B</code>.</p> |
396 | |||
397 | <p>The width of a pixel on Display <code>A</code> is <em>double</em> the width of a | ||
398 | pixel on Display <code>B</code>. The area occupied by a pixel on Display | ||
399 | <code>A</code> is <em>4 times</em> the area occupied by a pixel on Display <code>B</code>.</p> | ||
400 | |||
401 | <p><em>The size of a pixel varies from display to display!</em></p> | 179 | <p><em>The size of a pixel varies from display to display!</em></p> |
402 | 180 | <p>A 5x11 bitmap font on Display <code>A</code> would be around 4 mm tall whereas the same bitmap font on Display <code>B</code> would be around 1.9 mm tall. A 11 px tall character on <code>B</code> is visually equivalent to a 5 px character on <code>A</code>. When you view a screenshot of Display <code>A</code> on Display <code>B</code>, the contents are shrunk down by a factor of 2!</p> | |
403 | <p>A 5x11 bitmap font on Display <code>A</code> would be around 4 mm tall | 181 | <p>So screen resolution is not enough, how else do we measure size? Pixel Density! Keen readers will realize that the 5^th grade math problem we solved up there showcases pixel density, or, pixels per cm (PPCM). Usually we deal with pixels per inch (PPI).</p> |
404 | whereas the same bitmap font on Display <code>B</code> would be around | 182 | <p><strong>Note:</strong> PPI is not to be confused with DPI <a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a> (dots per inch). DPI is defined for printers.</p> |
405 | 1.9 mm tall. A 11 px tall character on <code>B</code> is visually | 183 | <p>In our example, <code>A</code> is a 75 ppi display and <code>B</code> is around 165 ppi <a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"><sup>3</sup></a>. A low ppi display appears to be ‘pixelated’, because the pixels are more prominent, much like Display <code>A</code>. A higher ppi usually means you can view larger images and render crispier fonts. The average desktop display can stuff 100-200 pixels per inch. Smart phones usually fall into the 400-600 ppi (XXXHDPI) category. The human eye fails to differentiate detail past 300 ppi.</p> |
406 | equivalent to a 5 px character on <code>A</code>. When you view a | 184 | <p><em>So … streaming an 8K video on a 60" TV provides the same clarity as a HD video on a smart phone?</em></p> |
407 | screenshot of Display <code>A</code> on Display <code>B</code>, the contents are | 185 | <p>Absolutely. Well, clarity is subjective, but the amount of detail you can discern on mobile displays has always been limited. Salty consumers of the Xperia 1 <a href="#fn4" class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a> will say otherwise.</p> |
408 | shrunk down by a factor of 2!</p> | 186 | <p>Maybe I will talk about font rendering in another post, but thats all for now. Don’t judge a font size by its screenshot.</p> |
409 | 187 | <section class="footnotes" role="doc-endnotes"> | |
410 | <p>So screen resolution is not enough, how else do we measure | 188 | <hr /> |
411 | size? Pixel Density! Keen readers will realize that the 5<sup>th</sup> | ||
412 | grade math problem we solved up there showcases pixel | ||
413 | density, or, pixels per cm (PPCM). Usually we deal with | ||
414 | pixels per inch (PPI).</p> | ||
415 | |||
416 | <p><strong>Note:</strong> PPI is not to be confused with DPI <sup id="fnref2"><a href="#fn2" rel="footnote">2</a></sup> (dots | ||
417 | per inch). DPI is defined for printers.</p> | ||
418 | |||
419 | <p>In our example, <code>A</code> is a 75 ppi display and <code>B</code> is around | ||
420 | 165 ppi <sup id="fnref3"><a href="#fn3" rel="footnote">3</a></sup>. A low ppi display appears to be | ||
421 | ‘pixelated’, because the pixels are more prominent, much | ||
422 | like Display <code>A</code>. A higher ppi usually means you can view | ||
423 | larger images and render crispier fonts. The average desktop | ||
424 | display can stuff 100-200 pixels per inch. Smart phones | ||
425 | usually fall into the 400-600 ppi (XXXHDPI) category. The | ||
426 | human eye fails to differentiate detail past 300 ppi.</p> | ||
427 | |||
428 | <p><em>So … streaming an 8K video on a 60” TV provides the same | ||
429 | clarity as a HD video on a smart phone?</em></p> | ||
430 | |||
431 | <p>Absolutely. Well, clarity is subjective, but the amount of | ||
432 | detail you can discern on mobile displays has always been | ||
433 | limited. Salty consumers of the Xperia 1 <sup id="fnref4"><a href="#fn4" rel="footnote">4</a></sup> will say | ||
434 | otherwise.</p> | ||
435 | |||
436 | <p>Maybe I will talk about font rendering in another post, but | ||
437 | thats all for now. Don't judge a font size by its | ||
438 | screenshot.</p> | ||
439 | |||
440 | <div class="footnotes"> | ||
441 | <hr/> | ||
442 | <ol> | 189 | <ol> |
443 | 190 | <li id="fn1" role="doc-endnote"><p>https://github.com/nerdypepper/scientifica<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | |
444 | <li id="fn1"> | 191 | <li id="fn2" role="doc-endnote"><p>https://en.wikipedia.org/wiki/Dots_per_inch<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
445 | <p><a href="https://github.com/nerdypepper/scientifica">https://github.com/nerdypepper/scientifica</a> <a href="#fnref1" rev="footnote">↩</a></p> | 192 | <li id="fn3" role="doc-endnote"><p>https://www.sven.de/dpi/<a href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
446 | </li> | 193 | <li id="fn4" role="doc-endnote"><p>https://en.wikipedia.org/wiki/Sony_Xperia_1<a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
447 | |||
448 | <li id="fn2"> | ||
449 | <p><a href="https://en.wikipedia.org/wiki/Dots_per_inch">https://en.wikipedia.org/wiki/Dots_per_inch</a> <a href="#fnref2" rev="footnote">↩</a></p> | ||
450 | </li> | ||
451 | |||
452 | <li id="fn3"> | ||
453 | <p><a href="https://www.sven.de/dpi/">https://www.sven.de/dpi/</a> <a href="#fnref3" rev="footnote">↩</a></p> | ||
454 | </li> | ||
455 | |||
456 | <li id="fn4"> | ||
457 | <p><a href="https://en.wikipedia.org/wiki/Sony_Xperia_1">https://en.wikipedia.org/wiki/Sony_Xperia_1</a> <a href="#fnref4" rev="footnote">↩</a></p> | ||
458 | </li> | ||
459 | |||
460 | </ol> | 194 | </ol> |
461 | </div></description> | 195 | </section></description> |
462 | <link>https://peppe.rs/posts/font_size_fallacies/</link> | 196 | <link>https://peppe.rs/posts/font_size_fallacies/</link> |
463 | <pubDate>Tue, 17 Mar 2020 16:52:00 +0000</pubDate> | 197 | <pubDate>Tue, 17 Mar 2020 16:52:00 +0000</pubDate> |
464 | <guid>https://peppe.rs/posts/font_size_fallacies/</guid> | 198 | <guid>https://peppe.rs/posts/font_size_fallacies/</guid> |
465 | </item> | 199 | </item> |
466 | <item> | 200 | <item> |
467 | <title>Termux Tandem</title> | 201 | <title>Termux Tandem</title> |
468 | <description><p>I learnt about <code>termux</code> from a friend on IRC recently. | 202 | <description><p>I learnt about <code>termux</code> from a friend on IRC recently. It looked super gimmicky to me at first, but it eventually proved to be useful. Here’s what I use it for:</p> |
469 | It looked super gimmicky to me at first, but it eventually | ||
470 | proved to be useful. Here's what I use it for:</p> | ||
471 | |||
472 | <h3 id="rsync">rsync</h3> | 203 | <h3 id="rsync">rsync</h3> |
473 | 204 | <p>Ever since I degoogled my android device, syncing files between my phone and my PC has always been a pain. I’m looking at you MTP. But, with <code>termux</code> and <code>sshd</code> all set up, it’s as simple as:</p> | |
474 | <p>Ever since I degoogled my android device, syncing files | ||
475 | between my phone and my PC has always been a pain. I’m | ||
476 | looking at you MTP. But, with <code>termux</code> and <code>sshd</code> all set up, | ||
477 | it's as simple as:</p> | ||
478 | |||
479 | <pre><code>$ arp | 205 | <pre><code>$ arp |
480 | Address HWtype HWad ... | 206 | Address HWtype HWad ... |
481 | 192.168.43.187 ether d0:0 ... | 207 | 192.168.43.187 ether d0:0 ... |
482 | 208 | ||
483 | $ rsync -avz 192.168.43.187:~/frogs ~/pics/frogs | 209 | $ rsync -avz 192.168.43.187:~/frogs ~/pics/frogs</code></pre> |
484 | </code></pre> | 210 | <h3 id="ssh-tmux">ssh & tmux</h3> |
485 | 211 | <p>My phone doubles as a secondary view into my main machine with <code>ssh</code> and <code>tmux</code>. When I am away from my PC (read: sitting across the room), I check build status and IRC messages by <code>ssh</code>ing into a tmux session running the said build or weechat.</p> | |
486 | <h3 id="ssh%20&#38;%20tmux">ssh & tmux</h3> | 212 | <h3 id="file-uploads">file uploads</h3> |
487 | 213 | <p>Not being able to access my (ssh-only) file host was crippling. With a <code>bash</code> instance on my phone, I just copied over my ssh keys, and popped in a file upload script (a glorified <code>scp</code>). Now I just have to figure out a way to clean up these file names …</p> | |
488 | <p>My phone doubles as a secondary view into my main machine | 214 | <pre><code>~/storage/pictures/ $ ls |
489 | with <code>ssh</code> and <code>tmux</code>. When I am away from my PC (read: | ||
490 | sitting across the room), I check build status and IRC | ||
491 | messages by <code>ssh</code>ing into a tmux session running the said | ||
492 | build or weechat.</p> | ||
493 | |||
494 | <h3 id="file%20uploads">file uploads</h3> | ||
495 | |||
496 | <p>Not being able to access my (ssh-only) file host was | ||
497 | crippling. With a <code>bash</code> instance on my phone, I just copied | ||
498 | over my ssh keys, and popped in a file upload script (a | ||
499 | glorified <code>scp</code>). Now I just have to figure out a way to | ||
500 | clean up these file names …</p> | ||
501 | |||
502 | <pre><code>~/storage/pictures/ $ ls | ||
503 | 02muf5g7b2i41.jpg 7alt3cwg77841.jpg cl4bsrge7id11.png | 215 | 02muf5g7b2i41.jpg 7alt3cwg77841.jpg cl4bsrge7id11.png |
504 | mtZabXG.jpg p8d5c584f2841.jpg vjUxGjq.jpg | 216 | mtZabXG.jpg p8d5c584f2841.jpg vjUxGjq.jpg</code></pre> |
505 | </code></pre> | ||
506 | |||
507 | <h3 id="cmus">cmus</h3> | 217 | <h3 id="cmus">cmus</h3> |
508 | 218 | <p>Alright, I don’t really listen to music via <code>cmus</code>, but I did use it a couple times when my default music player was acting up. <code>cmus</code> is a viable option:</p> | |
509 | <p>Alright, I don't really listen to music via <code>cmus</code>, but I | 219 | <p><a href="https://u.peppe.rs/CP.jpg"><img src="https://u.peppe.rs/CP.jpg" /></a></p></description> |
510 | did use it a couple times when my default music player was | ||
511 | acting up. <code>cmus</code> is a viable option:</p> | ||
512 | |||
513 | <p><a href="https://u.peppe.rs/CP.jpg"><img src="https://u.peppe.rs/CP.jpg" alt="" /></a></p></description> | ||
514 | <link>https://peppe.rs/posts/termux_tandem/</link> | 220 | <link>https://peppe.rs/posts/termux_tandem/</link> |
515 | <pubDate>Sun, 08 Mar 2020 16:47:00 +0000</pubDate> | 221 | <pubDate>Sun, 08 Mar 2020 16:47:00 +0000</pubDate> |
516 | <guid>https://peppe.rs/posts/termux_tandem/</guid> | 222 | <guid>https://peppe.rs/posts/termux_tandem/</guid> |
517 | </item> | 223 | </item> |
518 | <item> | 224 | <item> |
519 | <title>Call To ARMs</title> | 225 | <title>Call To ARMs</title> |
520 | <description><p>My 4th semester involves ARM programming. And proprietary | 226 | <description><p>My 4th semester involves ARM programming. And proprietary tooling (Keil C). But we don’t do that here.</p> |
521 | tooling (Keil C). But we don't do that here.</p> | 227 | <h3 id="building">Building</h3> |
522 | 228 | <p>Assembling and linking ARM binaries on non-ARM architecture devices is fairly trivial. I went along with the GNU cross bare metal toolchain binutils, which provides <code>arm-as</code> and <code>arm-ld</code> (among a bunch of other utils that I don’t care about for now).</p> | |
523 | <h3 id="Building">Building</h3> | ||
524 | |||
525 | <p>Assembling and linking ARM binaries on non-ARM architecture | ||
526 | devices is fairly trivial. I went along with the GNU cross | ||
527 | bare metal toolchain binutils, which provides <code>arm-as</code> and | ||
528 | <code>arm-ld</code> (among a bunch of other utils that I don't care | ||
529 | about for now). </p> | ||
530 | |||
531 | <p>Assemble <code>.s</code> files with:</p> | 229 | <p>Assemble <code>.s</code> files with:</p> |
532 | 230 | <pre class="shell"><code>arm-none-eabi-as main.s -g -march=armv8.1-a -o main.out</code></pre> | |
533 | <pre><code class="language-shell">arm-none-eabi-as main.s -g -march=armv8.1-a -o main.out | 231 | <p>The <code>-g</code> flag generates extra debugging information that <code>gdb</code> picks up. The <code>-march</code> option establishes target architecture.</p> |
534 | </code></pre> | ||
535 | |||
536 | <p>The <code>-g</code> flag generates extra debugging information that | ||
537 | <code>gdb</code> picks up. The <code>-march</code> option establishes target | ||
538 | architecture.</p> | ||
539 | |||
540 | <p>Link <code>.o</code> files with:</p> | 232 | <p>Link <code>.o</code> files with:</p> |
541 | 233 | <pre class="shell"><code>arm-none-eabi-ld main.out -o main</code></pre> | |
542 | <pre><code class="language-shell">arm-none-eabi-ld main.out -o main | 234 | <h3 id="running-and-debugging">Running (and Debugging)</h3> |
543 | </code></pre> | 235 | <p>Things get interesting here. <code>gdb</code> on your x86 machine cannot read nor execute binaries compiled for ARM. So, we simulate an ARM processor using <code>qemu</code>. Now qemu allows you to run <code>gdbserver</code> on startup. Connecting our local <code>gdb</code> instance to <code>gdbserver</code> gives us a view into the program’s execution. Easy!</p> |
544 | 236 | <p>Run <code>qemu</code>, with <code>gdbserver</code> on port <code>1234</code>, with our ARM binary, <code>main</code>:</p> | |
545 | <h3 id="Running%20(and%20Debugging)">Running (and Debugging)</h3> | 237 | <pre class="shell"><code>qemu-arm -singlestep -g 1234 main</code></pre> |
546 | 238 | <p>Start up <code>gdb</code> on your machine, and connect to <code>qemu</code>’s <code>gdbserver</code>:</p> | |
547 | <p>Things get interesting here. <code>gdb</code> on your x86 machine | ||
548 | cannot read nor execute binaries compiled for ARM. So, we | ||
549 | simulate an ARM processor using <code>qemu</code>. Now qemu allows you | ||
550 | to run <code>gdbserver</code> on startup. Connecting our local <code>gdb</code> | ||
551 | instance to <code>gdbserver</code> gives us a view into the program’s | ||
552 | execution. Easy!</p> | ||
553 | |||
554 | <p>Run <code>qemu</code>, with <code>gdbserver</code> on port <code>1234</code>, with our ARM | ||
555 | binary, <code>main</code>:</p> | ||
556 | |||
557 | <pre><code class="language-shell">qemu-arm -singlestep -g 1234 main | ||
558 | </code></pre> | ||
559 | |||
560 | <p>Start up <code>gdb</code> on your machine, and connect to <code>qemu</code>’s | ||
561 | <code>gdbserver</code>:</p> | ||
562 | |||
563 | <pre><code>(gdb) set architecture armv8-a | 239 | <pre><code>(gdb) set architecture armv8-a |
564 | (gdb) target remote localhost:1234 | 240 | (gdb) target remote localhost:1234 |
565 | (gdb) file main | 241 | (gdb) file main |
566 | Reading symbols from main... # yay! | 242 | Reading symbols from main... # yay!</code></pre> |
567 | </code></pre> | 243 | <h3 id="gdb-enhanced">GDB Enhanced</h3> |
568 | 244 | <p><code>gdb</code> is cool, but it’s not nearly as comfortable as well fleshed out emulators/IDEs like Keil. Watching registers, CPSR and memory chunks update <em>is</em> pretty fun.</p> | |
569 | <h3 id="GDB%20Enhanced">GDB Enhanced</h3> | 245 | <p>I came across <code>gdb</code>’s TUI mode (hit <code>C-x C-a</code> or type <code>tui enable</code> at the prompt). TUI mode is a godsend. It highlights the current line of execution, shows you disassembly outputs, updated registers, active breakpoints and more.</p> |
570 | |||
571 | <p><code>gdb</code> is cool, but it's not nearly as comfortable as well | ||
572 | fleshed out emulators/IDEs like Keil. Watching registers, | ||
573 | CPSR and memory chunks update <em>is</em> pretty fun. </p> | ||
574 | |||
575 | <p>I came across <code>gdb</code>'s TUI mode (hit <code>C-x C-a</code> or type <code>tui | ||
576 | enable</code> at the prompt). TUI mode is a godsend. It highlights | ||
577 | the current line of execution, shows you disassembly | ||
578 | outputs, updated registers, active breakpoints and more.</p> | ||
579 | |||
580 | <p><em>But</em>, it is an absolute eyesore.</p> | 246 | <p><em>But</em>, it is an absolute eyesore.</p> |
581 | 247 | <p>Say hello to <a href="https://github.com/hugsy/gef">GEF</a>! “GDB Enhanced Features” teaches our old dog some cool new tricks. Here are some additions that made my ARM debugging experience loads better:</p> | |
582 | <p>Say hello to <a href="https://github.com/hugsy/gef">GEF</a>! “GDB | ||
583 | Enhanced Features” teaches our old dog some cool new tricks. | ||
584 | Here are some additions that made my ARM debugging | ||
585 | experience loads better:</p> | ||
586 | |||
587 | <ul> | 248 | <ul> |
588 | <li>Memory watches</li> | 249 | <li>Memory watches</li> |
589 | <li>Register watches, with up to 7 levels of deref (overkill, | 250 | <li>Register watches, with up to 7 levels of deref (overkill, I agree)</li> |
590 | I agree)</li> | ||
591 | <li>Stack tracing</li> | 251 | <li>Stack tracing</li> |
592 | </ul> | 252 | </ul> |
593 | 253 | <p>And it’s pretty! See for yourself:</p> | |
594 | <p>And it's pretty! See for yourself:</p> | 254 | <p><a href="https://u.peppe.rs/wq.png"><img src="https://u.peppe.rs/wq.png" /></a></p> |
595 | 255 | <h3 id="editing">Editing</h3> | |
596 | <p><a href="https://u.peppe.rs/wq.png"><img src="https://u.peppe.rs/wq.png" alt="" /></a></p> | 256 | <p>Vim, with <code>syntax off</code> because it dosen’t handle GNU ARM syntax too well.</p></description> |
597 | |||
598 | <h3 id="Editing">Editing</h3> | ||
599 | |||
600 | <p>Vim, with <code>syntax off</code> because it | ||
601 | dosen't handle GNU ARM syntax too well.</p></description> | ||
602 | <link>https://peppe.rs/posts/call_to_ARMs/</link> | 257 | <link>https://peppe.rs/posts/call_to_ARMs/</link> |
603 | <pubDate>Fri, 07 Feb 2020 18:30:00 +0000</pubDate> | 258 | <pubDate>Fri, 07 Feb 2020 18:30:00 +0000</pubDate> |
604 | <guid>https://peppe.rs/posts/call_to_ARMs/</guid> | 259 | <guid>https://peppe.rs/posts/call_to_ARMs/</guid> |
605 | </item> | 260 | </item> |
606 | <item> | 261 | <item> |
607 | <title>Color Conundrum</title> | 262 | <title>Color Conundrum</title> |
608 | <description><p>This piece aims to highlight (pun intended) some of the | 263 | <description><p>This piece aims to highlight (pun intended) some of the reasons behind my <a href="https://u.peppe.rs/bF.png">color free</a> editor setup.</p> |
609 | reasons behind my <a href="https://u.peppe.rs/bF.png">color | 264 | <p>Imagine highlighting an entire book because <em>all</em> of it is important. That is exactly what (most) syntax highlighting does. It is difficult for the human eye to filter out noise in rainbow barf. Use color to draw attention, not diverge it.</p> |
610 | free</a> editor setup.</p> | 265 | <p>At the same time, a book devoid of color is <em>boring!</em> What is the takeaway from this 10 line paragraph? What are the technical terms used?</p> |
611 | 266 | <p>Prose and code are certainly different, but the fickle minded human eye is the same. The eye constantly looks for a frame of reference, a focal point. It grows tired when it can’t find one.</p> | |
612 | <p>Imagine highlighting an entire book because <em>all</em> of it is | 267 | <p>The following comparison does a better job of explaining (none, ample and over-the-top highlighting, from left to right):</p> |
613 | important. That is exactly what (most) syntax highlighting | 268 | <p><a href="https://u.peppe.rs/lt.png"><img src="https://u.peppe.rs/lt.png" /></a></p> |
614 | does. It is difficult for the human eye to filter out noise | 269 | <p>Without highlighting (far left), it is hard to differentiate between comments and code! The florid color scheme (far right) is no good either, it contains too many attention grabbers. The center sample is a healthy balance of both. Function calls and constants stand out, and repetitive keywords and other noise (<code>let</code>, <code>as</code>) are mildly dimmed out. Comments and non-code text (sign column, status text) are dimmed further.</p> |
615 | in rainbow barf. Use color to draw attention, not diverge | 270 | <p>I’ll stop myself before I rant about color contrast and combinations.</p></description> |
616 | it.</p> | ||
617 | |||
618 | <p>At the same time, a book devoid of color is <em>boring!</em> What | ||
619 | is the takeaway from this 10 line paragraph? What are the | ||
620 | technical terms used?</p> | ||
621 | |||
622 | <p>Prose and code are certainly different, but the fickle | ||
623 | minded human eye is the same. The eye constantly looks for a | ||
624 | frame of reference, a focal point. It grows tired when it | ||
625 | can't find one.</p> | ||
626 | |||
627 | <p>The following comparison does a better job of explaining | ||
628 | (none, ample and over-the-top highlighting, from left to | ||
629 | right):</p> | ||
630 | |||
631 | <p><a href="https://u.peppe.rs/lt.png"><img src="https://u.peppe.rs/lt.png" alt="" /></a></p> | ||
632 | |||
633 | <p>Without highlighting (far left), it is hard to differentiate | ||
634 | between comments and code! The florid color scheme (far | ||
635 | right) is no good either, it contains too many attention | ||
636 | grabbers. The center sample is a healthy balance of both. | ||
637 | Function calls and constants stand out, and repetitive | ||
638 | keywords and other noise (<code>let</code>, <code>as</code>) are mildly dimmed | ||
639 | out. Comments and non-code text (sign column, status text) | ||
640 | are dimmed further.</p> | ||
641 | |||
642 | <p>I'll stop myself before I rant about color contrast and | ||
643 | combinations.</p></description> | ||
644 | <link>https://peppe.rs/posts/color_conundrum/</link> | 271 | <link>https://peppe.rs/posts/color_conundrum/</link> |
645 | <pubDate>Mon, 30 Dec 2019 18:30:00 +0000</pubDate> | 272 | <pubDate>Mon, 30 Dec 2019 18:30:00 +0000</pubDate> |
646 | <guid>https://peppe.rs/posts/color_conundrum/</guid> | 273 | <guid>https://peppe.rs/posts/color_conundrum/</guid> |
647 | </item> | 274 | </item> |
648 | <item> | 275 | <item> |
649 | <title>Static Sites With Bash</title> | 276 | <title>Static Sites With Bash</title> |
650 | <description><p>After going through a bunch of static site generators | 277 | <description><p>After going through a bunch of static site generators (<a href="https://blog.getpelican.com/">pelican</a>, <a href="https://gohugo.io">hugo</a>, <a href="https://github.com/icyphox/vite">vite</a>), I decided to roll my own. If you are more of the ‘show me the code’ kinda guy, <a href="https://github.com/nerdypepper/site">here</a> you go.</p> |
651 | (<a href="https://blog.getpelican.com/">pelican</a>, | 278 | <h3 id="text-formatting">Text formatting</h3> |
652 | <a href="https://gohugo.io">hugo</a>, | 279 | <p>I chose to write in markdown, and convert to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p> |
653 | <a href="https://github.com/icyphox/vite">vite</a>), I decided to roll | 280 | <h3 id="directory-structure">Directory structure</h3> |
654 | my own. If you are more of the ‘show me the code’ kinda guy, | 281 | <p>I host my site on GitHub pages, so <code>docs/</code> has to be the entry point. Markdown formatted posts go into <code>posts/</code>, get converted into html, and end up in <code>docs/index.html</code>, something like this:</p> |
655 | <a href="https://github.com/nerdypepper/site">here</a> you go.</p> | 282 | <div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1"></a><span class="va">posts=$(</span><span class="fu">ls</span> -t ./posts<span class="va">)</span> <span class="co"># chronological order!</span></span> |
656 | 283 | <span id="cb1-2"><a href="#cb1-2"></a><span class="kw">for</span> <span class="ex">f</span> in <span class="va">$posts</span><span class="kw">;</span> <span class="kw">do</span></span> | |
657 | <h3 id="Text%20formatting">Text formatting</h3> | 284 | <span id="cb1-3"><a href="#cb1-3"></a> <span class="va">file=</span><span class="st">"./posts/"</span><span class="va">$f</span> <span class="co"># `ls` mangled our file paths</span></span> |
658 | 285 | <span id="cb1-4"><a href="#cb1-4"></a> <span class="bu">echo</span> <span class="st">"generating post </span><span class="va">$file</span><span class="st">"</span></span> | |
659 | <p>I chose to write in markdown, and convert | 286 | <span id="cb1-5"><a href="#cb1-5"></a></span> |
660 | to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p> | 287 | <span id="cb1-6"><a href="#cb1-6"></a> <span class="va">html=$(</span><span class="ex">lowdown</span> <span class="st">"</span><span class="va">$file</span><span class="st">"</span><span class="va">)</span></span> |
661 | 288 | <span id="cb1-7"><a href="#cb1-7"></a> <span class="bu">echo</span> -e <span class="st">"html"</span> <span class="op">>></span> docs/index.html</span> | |
662 | <h3 id="Directory%20structure">Directory structure</h3> | 289 | <span id="cb1-8"><a href="#cb1-8"></a><span class="kw">done</span></span></code></pre></div> |
663 | 290 | <h3 id="assets">Assets</h3> | |
664 | <p>I host my site on GitHub pages, so | 291 | <p>Most static site generators recommend dropping image assets into the site source itself. That does have it’s merits, but I prefer hosting images separately:</p> |
665 | <code>docs/</code> has to be the entry point. Markdown formatted posts | 292 | <div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1"></a><span class="co"># strip file extension</span></span> |
666 | go into <code>posts/</code>, get converted into html, and end up in | 293 | <span id="cb2-2"><a href="#cb2-2"></a><span class="va">ext=</span><span class="st">"</span><span class="va">${1##</span>*.<span class="va">}</span><span class="st">"</span></span> |
667 | <code>docs/index.html</code>, something like this:</p> | 294 | <span id="cb2-3"><a href="#cb2-3"></a></span> |
668 | 295 | <span id="cb2-4"><a href="#cb2-4"></a><span class="co"># generate a random file name</span></span> | |
669 | <pre><code class="language-bash">posts=$(ls -t ./posts) # chronological order! | 296 | <span id="cb2-5"><a href="#cb2-5"></a><span class="va">id=$(</span> <span class="fu">cat</span> /dev/urandom <span class="kw">|</span> <span class="fu">tr</span> -dc <span class="st">'a-zA-Z0-9'</span> <span class="kw">|</span> <span class="ex">fold</span> -w 2 <span class="kw">|</span> <span class="fu">head</span> -n 1 <span class="va">)</span></span> |
670 | for f in $posts; do | 297 | <span id="cb2-6"><a href="#cb2-6"></a><span class="va">id=</span><span class="st">"</span><span class="va">$id</span><span class="st">.</span><span class="va">$ext</span><span class="st">"</span></span> |
671 | file="./posts/"$f # `ls` mangled our file paths | 298 | <span id="cb2-7"><a href="#cb2-7"></a></span> |
672 | echo "generating post $file" | 299 | <span id="cb2-8"><a href="#cb2-8"></a><span class="co"># copy to my file host</span></span> |
673 | 300 | <span id="cb2-9"><a href="#cb2-9"></a><span class="fu">scp</span> -P 443 <span class="st">"</span><span class="va">$1</span><span class="st">"</span> emerald:files/<span class="st">"</span><span class="va">$id</span><span class="st">"</span> </span> | |
674 | html=$(lowdown "$file") | 301 | <span id="cb2-10"><a href="#cb2-10"></a><span class="bu">echo</span> <span class="st">"https://u.peppe.rs/</span><span class="va">$id</span><span class="st">"</span></span></code></pre></div> |
675 | echo -e "html" >> docs/index.html | 302 | <h3 id="templating">Templating</h3> |
676 | done | 303 | <p><a href="https://github.com/NerdyPepper/site/blob/master/generate.sh"><code>generate.sh</code></a> brings the above bits and pieces together (with some extra cruft to avoid javascript). It uses <code>sed</code> to produce nice titles from the file names (removes underscores, title-case), and <code>date(1)</code> to add the date to each post listing!</p></description> |
677 | </code></pre> | ||
678 | |||
679 | <h3 id="Assets">Assets</h3> | ||
680 | |||
681 | <p>Most static site generators recommend dropping image | ||
682 | assets into the site source itself. That does have it’s | ||
683 | merits, but I prefer hosting images separately:</p> | ||
684 | |||
685 | <pre><code class="language-bash"># strip file extension | ||
686 | ext="${1##*.}" | ||
687 | |||
688 | # generate a random file name | ||
689 | id=$( cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1 ) | ||
690 | id="$id.$ext" | ||
691 | |||
692 | # copy to my file host | ||
693 | scp -P 443 "$1" emerald:files/"$id" | ||
694 | echo "https://u.peppe.rs/$id" | ||
695 | </code></pre> | ||
696 | |||
697 | <h3 id="Templating">Templating</h3> | ||
698 | |||
699 | <p><a href="https://github.com/NerdyPepper/site/blob/master/generate.sh"><code>generate.sh</code></a> | ||
700 | brings the above bits and pieces together (with some extra | ||
701 | cruft to avoid javascript). It uses <code>sed</code> to produce nice | ||
702 | titles from the file names (removes underscores, | ||
703 | title-case), and <code>date(1)</code> to add the date to each post | ||
704 | listing!</p></description> | ||
705 | <link>https://peppe.rs/posts/static_sites_with_bash/</link> | 304 | <link>https://peppe.rs/posts/static_sites_with_bash/</link> |
706 | <pubDate>Fri, 22 Nov 2019 18:30:00 +0000</pubDate> | 305 | <pubDate>Fri, 22 Nov 2019 18:30:00 +0000</pubDate> |
707 | <guid>https://peppe.rs/posts/static_sites_with_bash/</guid> | 306 | <guid>https://peppe.rs/posts/static_sites_with_bash/</guid> |
708 | </item> | 307 | </item> |
709 | <item> | 308 | <item> |
710 | <title>My Setup</title> | 309 | <title>My Setup</title> |
711 | <description><p>Decided to do one of these because everyone does one of | 310 | <description><p>Decided to do one of these because everyone does one of these.</p> |
712 | these.</p> | 311 | <p><img src="https://u.peppe.rs/Hb.png" /></p> |
713 | 312 | <p>My entire setup is managed with GNU <code>stow</code>, making it easier to replicate on fresh installations. You can find my configuration files on <a href="https://github.com/nerdypepper">GitHub</a>.</p> | |
714 | <p><img src="https://u.peppe.rs/Hb.png" alt="" /></p> | 313 | <p>I run Void Linux (glibc) on my <a href="https://store.hp.com/us/en/mdp/laptops/envy-13">HP Envy 13" (2018)</a>. To keep things simple, I run a raw X session with <code>2bwm</code> as my window manager, along with <code>dunst</code> (notification daemon) and Sam’s <a href="https://github.com/sdhand/compton"><code>compton</code></a> (compositor) fork.</p> |
715 | 314 | <p>I am a fan of GNU tools, so I use <code>bash</code> as my shell, and <code>coreutils</code> to manage files, archives, strings, paths etc. I edit files with <code>vim</code>, chat with <code>weechat</code>, listen to music with <code>cmus</code>, monitor processes with <code>htop</code>, manage sessions with <code>tmux</code>, read pdfs in <code>zathura</code>. I rarely ever leave the comfort of my terminal emulator, <code>urxvt</code>.</p> | |
716 | <p>My entire setup is managed with GNU <code>stow</code>, making it easier | 315 | <p>Most of my academic typesetting is done with TeX, and compiled with <code>xelatex</code>. Other <em>fun</em> documents are made with GIMP :).</p></description> |
717 | to replicate on fresh installations. You can find my | ||
718 | configuration files on <a href="https://github.com/nerdypepper">GitHub</a>.</p> | ||
719 | |||
720 | <p>I run Void Linux (glibc) on my | ||
721 | <a href="https://store.hp.com/us/en/mdp/laptops/envy-13">HP Envy 13” (2018)</a>. | ||
722 | To keep things simple, I run a raw X session with <code>2bwm</code> as my | ||
723 | window manager, along with <code>dunst</code> (notification daemon) and | ||
724 | Sam's <a href="https://github.com/sdhand/compton"><code>compton</code></a> | ||
725 | (compositor) fork.</p> | ||
726 | |||
727 | <p>I am a fan of GNU tools, so I use <code>bash</code> as my shell, and | ||
728 | <code>coreutils</code> to manage files, archives, strings, paths etc. I | ||
729 | edit files with <code>vim</code>, chat with <code>weechat</code>, listen to music | ||
730 | with <code>cmus</code>, monitor processes with <code>htop</code>, manage sessions | ||
731 | with <code>tmux</code>, read pdfs in <code>zathura</code>. I rarely ever leave | ||
732 | the comfort of my terminal emulator, <code>urxvt</code>.</p> | ||
733 | |||
734 | <p>Most of my academic typesetting is done with TeX, and | ||
735 | compiled with <code>xelatex</code>. Other <em>fun</em> documents are made with | ||
736 | GIMP :).</p></description> | ||
737 | <link>https://peppe.rs/posts/my_setup/</link> | 316 | <link>https://peppe.rs/posts/my_setup/</link> |
738 | <pubDate>Wed, 06 Nov 2019 18:30:00 +0000</pubDate> | 317 | <pubDate>Wed, 06 Nov 2019 18:30:00 +0000</pubDate> |
739 | <guid>https://peppe.rs/posts/my_setup/</guid> | 318 | <guid>https://peppe.rs/posts/my_setup/</guid> |
740 | </item> | 319 | </item> |
741 | <item> | 320 | <item> |
742 | <title>WPA Woes</title> | 321 | <title>WPA Woes</title> |
743 | <description><p>I finally got around to installing Void GNU/Linux on my main | 322 | <description><p>I finally got around to installing Void GNU/Linux on my main computer. Rolling release, non-systemd, need I say more?</p> |
744 | computer. Rolling release, non-systemd, need I say more?</p> | 323 | <p>As with all GNU/Linux distributions, wireless networks had me in a fix. If you can see this post, it means I’ve managed to get online. It turns out, <code>wpa_supplicant</code> was detecting the wrong interface by default (does it ever select the right one?). Let us fix that:</p> |
745 | 324 | <pre><code>$ sudo rm -r /var/service/wpa_supplicant | |
746 | <p>As with all GNU/Linux distributions, wireless networks had | 325 | $ sudo killall dhcpcd</code></pre> |
747 | me in a fix. If you can see this post, it means I've managed | ||
748 | to get online. It turns out, <code>wpa_supplicant</code> was detecting the | ||
749 | wrong interface by default (does it ever select the right | ||
750 | one?). Let us fix that:</p> | ||
751 | |||
752 | <pre><code>$ sudo rm -r /var/service/wpa_supplicant | ||
753 | $ sudo killall dhcpcd | ||
754 | </code></pre> | ||
755 | |||
756 | <p>What is the right interface though?</p> | 326 | <p>What is the right interface though?</p> |
757 | |||
758 | <pre><code>$ iw dev | 327 | <pre><code>$ iw dev |
759 | ... | 328 | ... |
760 | Interface wlp2s0 | 329 | Interface wlp2s0 |
761 | ... | 330 | ...</code></pre> |
762 | </code></pre> | 331 | <p>Aha! Let us run <code>wpa_supplicant</code> on that interface, as a background process:</p> |
763 | 332 | <pre><code>$ sudo wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf | |
764 | <p>Aha! Let us run <code>wpa_supplicant</code> on that interface, as a | ||
765 | background process:</p> | ||
766 | |||
767 | <pre><code>$ sudo wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf | ||
768 | $ sudo dhcpcd -B wlp2s0 | 333 | $ sudo dhcpcd -B wlp2s0 |
769 | $ ping google.com | 334 | $ ping google.com |
770 | PING ... | 335 | PING ...</code></pre> |
771 | </code></pre> | ||
772 | |||
773 | <p>Yay! Make those changes perpetual by enabling the service:</p> | 336 | <p>Yay! Make those changes perpetual by enabling the service:</p> |
774 | |||
775 | <pre><code>------------------------------------------------------ | 337 | <pre><code>------------------------------------------------------ |
776 | # Add these to /etc/wpa_supplicant/wpa_supplicant.conf | 338 | # Add these to /etc/wpa_supplicant/wpa_supplicant.conf |
777 | OPTS="-B" | 339 | OPTS="-B" |
778 | WPA_INTERFACE="wlp2s0" | 340 | WPA_INTERFACE="wlp2s0" |
779 | ------------------------------------------------------ | 341 | ------------------------------------------------------ |
780 | $ sudo ln -s /etc/sv/wpa_supplicant /var/service/ | 342 | $ sudo ln -s /etc/sv/wpa_supplicant /var/service/ |
781 | $ sudo ln -s /etc/sv/dhcpcd /var/service/ | 343 | $ sudo ln -s /etc/sv/dhcpcd /var/service/ |
782 | $ sudo sv restart wpa_supplicant | 344 | $ sudo sv restart wpa_supplicant |
783 | $ sudo sv restart dhcpcd | 345 | $ sudo sv restart dhcpcd</code></pre></description> |
784 | </code></pre></description> | ||
785 | <link>https://peppe.rs/posts/WPA_woes/</link> | 346 | <link>https://peppe.rs/posts/WPA_woes/</link> |
786 | <pubDate>Sat, 12 Oct 2019 16:18:00 +0000</pubDate> | 347 | <pubDate>Sat, 12 Oct 2019 16:18:00 +0000</pubDate> |
787 | <guid>https://peppe.rs/posts/WPA_woes/</guid> | 348 | <guid>https://peppe.rs/posts/WPA_woes/</guid> |
788 | </item> | 349 | </item> |
789 | <item> | 350 | <item> |
790 | <title>Bye Bye BDFs</title> | 351 | <title>Bye Bye BDFs</title> |
791 | <description><p>Glyph Bitmap Distribution Format is no more, as the creators of | 352 | <description><p>Glyph Bitmap Distribution Format is no more, as the creators of <a href="https://pango.org">Pango</a>, one of the most widely used text rendering libraries, <a href="https://blogs.gnome.org/mclasen/2019/05/25/pango-future-directions/">announced</a> their plans for Pango 1.44.</p> |
792 | <a href="https://pango.org">Pango</a>, one of the most widely used text rendering | 353 | <p>Until recently, Pango used FreeType to draw fonts. They will be moving over to <a href="https://harfbuzz.org">Harfbuzz</a>, an evolution of FreeType.</p> |
793 | libraries, | ||
794 | <a href="https://blogs.gnome.org/mclasen/2019/05/25/pango-future-directions/">announced</a> | ||
795 | their plans for Pango 1.44.</p> | ||
796 | |||
797 | <p>Until recently, Pango used FreeType to draw fonts. They will be moving over | ||
798 | to <a href="https://harfbuzz.org">Harfbuzz</a>, an evolution of FreeType.</p> | ||
799 | |||
800 | <p><em>Why?</em></p> | 354 | <p><em>Why?</em></p> |
801 | 355 | <p>In short, FreeType was hard to work with. It required complex logic, and provided no advantage over Harfbuzz (other than being able to fetch opentype metrics with ease).</p> | |
802 | <p>In short, FreeType was hard to work with. It required complex logic, and | 356 | <p>Upgrading to Pango v1.44 will break your GTK applications (if you use a <code>bdf</code>/<code>pcf</code> bitmap font). Harfbuzz <em>does</em> support bitmap-only OpenType fonts, <code>otb</code>s. Convert your existing fonts over to <code>otb</code>s using <a href="https://fontforge.github.io">FontForge</a>. It is to be noted that applications such as <code>xterm</code> and <code>rxvt</code> use <code>xft</code> (X FreeType) to render fonts, and will remain unaffected by the update.</p> |
803 | provided no advantage over Harfbuzz (other than being able to fetch | 357 | <p>Both <a href="https://github.com/nerdypepper/scientifica">scientifica</a> and <a href="https://github.com/nerdypepper/curie">curie</a> will soon ship with bitmap-only OpenType font formats.</p></description> |
804 | opentype metrics with ease).</p> | ||
805 | |||
806 | <p>Upgrading to Pango v1.44 will break your GTK applications (if you use a | ||
807 | <code>bdf</code>/<code>pcf</code> bitmap font). Harfbuzz <em>does</em> support bitmap-only OpenType fonts, | ||
808 | <code>otb</code>s. Convert your existing fonts over to <code>otb</code>s using | ||
809 | <a href="https://fontforge.github.io">FontForge</a>. It is to be noted that applications | ||
810 | such as <code>xterm</code> and <code>rxvt</code> use <code>xft</code> (X FreeType) to render fonts, and will | ||
811 | remain unaffected by the update.</p> | ||
812 | |||
813 | <p>Both <a href="https://github.com/nerdypepper/scientifica">scientifica</a> and | ||
814 | <a href="https://github.com/nerdypepper/curie">curie</a> will soon ship with bitmap-only | ||
815 | OpenType font formats.</p></description> | ||
816 | <link>https://peppe.rs/posts/bye_bye_BDFs/</link> | 358 | <link>https://peppe.rs/posts/bye_bye_BDFs/</link> |
817 | <pubDate>Wed, 07 Aug 2019 12:31:00 +0000</pubDate> | 359 | <pubDate>Wed, 07 Aug 2019 12:31:00 +0000</pubDate> |
818 | <guid>https://peppe.rs/posts/bye_bye_BDFs/</guid> | 360 | <guid>https://peppe.rs/posts/bye_bye_BDFs/</guid> |
819 | </item> | 361 | </item> |
820 | <item> | 362 | <item> |
821 | <title>Onivim Sucks</title> | 363 | <title>Onivim Sucks</title> |
822 | <description><p><a href="https://v2.onivim.io">Onivim</a> is a ‘modern modal editor’, combining fancy | 364 | <description><p><a href="https://v2.onivim.io">Onivim</a> is a ‘modern modal editor’, combining fancy interface and language features with vim-style modal editing. What’s wrong you ask?</p> |
823 | interface and language features with vim-style modal editing. What's wrong you | 365 | <p>Apart from <a href="https://github.com/onivim/oni2/issues/550">buggy syntax highlighting</a>, <a href="https://github.com/onivim/oni2/issues/519">broken scrolling</a> and <a href="https://github.com/onivim/oni2/issues?q=is%3Aissue+label%3A%22daily+editor+blocker%22+is%3Aopen">others</a>, Onivim is <strong>proprietary</strong> software. It is licensed under a commercial <a href="https://github.com/onivim/oni1/blob/master/Outrun-Labs-EULA-v1.1.md">end user agreement license</a>, which prohibits redistribution in both object code and source code formats.</p> |
824 | ask?</p> | 366 | <p>Onivim’s core editor logic (bits that belong to vim), have been separated from the interface, into <a href="https://github.com/onivim/libvim">libvim</a>. libvim is licensed under MIT, which means, this ‘extension’ of vim is perfectly in adherence to <a href="http://vimdoc.sourceforge.net/htmldoc/uganda.html#license">vim’s license text</a>! Outrun Labs are exploiting this loophole (distributing vim as a library) to commercialize Onivim.</p> |
825 | 367 | <p>Onivim’s source code is available on <a href="https://github.com/onivim/oni2">GitHub</a>. They do mention that the source code trickles down to the <a href="https://github.com/onivim/oni2-mit">oni2-mit</a> repository, which (not yet) contains MIT-licensed code, <strong>18 months</strong> after each commit to the original repository.</p> | |
826 | <p>Apart from <a href="https://github.com/onivim/oni2/issues/550">buggy syntax highlighting</a>, | 368 | <p>Want to contribute to Onivim? Don’t. They make a profit out of your contributions. Currently, Onivim is priced at $19.99, ‘pre-alpha’ pricing which is 80% off the final price! If you are on the lookout for an editor, I would suggest using <a href="https://vim.org">Vim</a>, charity ware that actually works, and costs $100 lesser.</p></description> |
827 | <a href="https://github.com/onivim/oni2/issues/519">broken scrolling</a> and | ||
828 | <a href="https://github.com/onivim/oni2/issues?q=is%3Aissue+label%3A%22daily+editor+blocker%22+is%3Aopen">others</a>, | ||
829 | Onivim is <strong>proprietary</strong> software. It is licensed under a commercial | ||
830 | <a href="https://github.com/onivim/oni1/blob/master/Outrun-Labs-EULA-v1.1.md">end user agreement license</a>, | ||
831 | which prohibits redistribution in both object code and source code formats.</p> | ||
832 | |||
833 | <p>Onivim's core editor logic (bits that belong to vim), have been separated from | ||
834 | the interface, into <a href="https://github.com/onivim/libvim">libvim</a>. libvim is | ||
835 | licensed under MIT, which means, this ‘extension’ of vim is perfectly in | ||
836 | adherence to <a href="http://vimdoc.sourceforge.net/htmldoc/uganda.html#license">vim's license text</a>! | ||
837 | Outrun Labs are exploiting this loophole (distributing vim as a library) to | ||
838 | commercialize Onivim.</p> | ||
839 | |||
840 | <p>Onivim's source code is available on <a href="https://github.com/onivim/oni2">GitHub</a>. | ||
841 | They do mention that the source code trickles down to the | ||
842 | <a href="https://github.com/onivim/oni2-mit">oni2-mit</a> repository, which (not yet) contains | ||
843 | MIT-licensed code, <strong>18 months</strong> after each commit to the original repository.</p> | ||
844 | |||
845 | <p>Want to contribute to Onivim? Don't. They make a profit out of your contributions. | ||
846 | Currently, Onivim is priced at $19.99, ‘pre-alpha’ pricing which is 80% off the | ||
847 | final price! If you are on the lookout for an editor, I would suggest using | ||
848 | <a href="https://vim.org">Vim</a>, charity ware that actually works, and costs $100 lesser.</p></description> | ||
849 | <link>https://peppe.rs/posts/onivim_sucks/</link> | 369 | <link>https://peppe.rs/posts/onivim_sucks/</link> |
850 | <pubDate>Fri, 02 Aug 2019 12:31:00 +0000</pubDate> | 370 | <pubDate>Fri, 02 Aug 2019 12:31:00 +0000</pubDate> |
851 | <guid>https://peppe.rs/posts/onivim_sucks/</guid> | 371 | <guid>https://peppe.rs/posts/onivim_sucks/</guid> |
852 | </item> | 372 | </item> |
853 | <item> | 373 | <item> |
854 | <title>Bash Harder With Vim</title> | 374 | <title>Bash Harder With Vim</title> |
855 | <description><p>Bash is tricky, don't let your editor get in your way. Here's a couple of neat | 375 | <description><p>Bash is tricky, don’t let your editor get in your way. Here’s a couple of neat additions you could make to your <code>vimrc</code> for a better shell programming experience.</p> |
856 | additions you could make to your <code>vimrc</code> for a better shell programming | 376 | <h3 id="man-pages-inside-vim">Man pages inside vim</h3> |
857 | experience.</p> | 377 | <p>Source this script to get started:</p> |
858 | 378 | <pre><code>runtime ftplugin/man.vim</code></pre> | |
859 | <h3 id="Man%20pages%20inside%20vim">Man pages inside vim</h3> | 379 | <p>Now, you can open manpages inside vim with <code>:Man</code>! It adds nicer syntax highlighting and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.</p> |
860 | |||
861 | <p>Source this script to get started: </p> | ||
862 | |||
863 | <pre><code>runtime ftplugin/man.vim | ||
864 | </code></pre> | ||
865 | |||
866 | <p>Now, you can open manpages inside vim with <code>:Man</code>! It adds nicer syntax highlighting | ||
867 | and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.</p> | ||
868 | |||
869 | <p>By default, the manpage is opened in a horizontal split, I prefer using a new tab:</p> | 380 | <p>By default, the manpage is opened in a horizontal split, I prefer using a new tab:</p> |
870 | 381 | <pre><code>let g:ft_man_open_mode = 'tab'</code></pre> | |
871 | <pre><code>let g:ft_man_open_mode = 'tab' | 382 | <h3 id="scratchpad-to-test-your-commands">Scratchpad to test your commands</h3> |
872 | </code></pre> | 383 | <p>I often test my <code>sed</code> substitutions, here is a sample from the script used to generate this site:</p> |
873 | |||
874 | <h3 id="Scratchpad%20to%20test%20your%20commands">Scratchpad to test your commands</h3> | ||
875 | |||
876 | <p>I often test my <code>sed</code> substitutions, here is | ||
877 | a sample from the script used to generate this site: </p> | ||
878 | |||
879 | <pre><code># a substitution to convert snake_case to Title Case With Spaces | 384 | <pre><code># a substitution to convert snake_case to Title Case With Spaces |
880 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g" | 385 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g"</code></pre> |
881 | </code></pre> | ||
882 | |||
883 | <p>Instead of dropping into a new shell, just test it out directly from vim!</p> | 386 | <p>Instead of dropping into a new shell, just test it out directly from vim!</p> |
884 | |||
885 | <ul> | 387 | <ul> |
886 | <li><p>Yank the line into a register:</p> | 388 | <li>Yank the line into a register:</li> |
887 | 389 | </ul> | |
888 | <pre><code>yy | 390 | <pre><code>yy</code></pre> |
889 | </code></pre></li> | 391 | <ul> |
890 | <li><p>Paste it into the command-line window:</p> | 392 | <li>Paste it into the command-line window:</li> |
891 | 393 | </ul> | |
892 | <pre><code>q:p | 394 | <pre><code>q:p</code></pre> |
893 | </code></pre></li> | 395 | <ul> |
894 | <li><p>Make edits as required:</p> | 396 | <li>Make edits as required:</li> |
895 | 397 | </ul> | |
896 | <pre><code>syntax off # previously run commands | 398 | <pre><code>syntax off # previously run commands |
897 | edit index.html # in a buffer! | 399 | edit index.html # in a buffer! |
898 | w | so % | 400 | w | so % |
899 | !echo "new_post.md" | sed -E -e "s/\..+$//g" --snip-- | 401 | !echo "new_post.md" | sed -E -e "s/\..+$//g" --snip-- |
900 | ^--- note the use of '!' | 402 | ^--- note the use of '!'</code></pre> |
901 | </code></pre></li> | 403 | <ul> |
902 | <li><p>Hit enter with the cursor on the line containing your command!</p> | 404 | <li>Hit enter with the cursor on the line containing your command!</li> |
903 | 405 | </ul> | |
904 | <pre><code>$ vim | 406 | <pre><code>$ vim |
905 | New Post # output | 407 | New Post # output |
906 | Press ENTER or type command to continue | 408 | Press ENTER or type command to continue</code></pre></description> |
907 | </code></pre></li> | ||
908 | </ul></description> | ||
909 | <link>https://peppe.rs/posts/bash_harder_with_vim/</link> | 409 | <link>https://peppe.rs/posts/bash_harder_with_vim/</link> |
910 | <pubDate>Wed, 31 Jul 2019 06:30:00 +0000</pubDate> | 410 | <pubDate>Wed, 31 Jul 2019 06:30:00 +0000</pubDate> |
911 | <guid>https://peppe.rs/posts/bash_harder_with_vim/</guid> | 411 | <guid>https://peppe.rs/posts/bash_harder_with_vim/</guid> |
912 | </item> | 412 | </item> |
913 | <item> | 413 | <item> |
914 | <title>Hold Position!</title> | 414 | <title>Hold Position!</title> |
915 | <description><p>Often times, when I run a vim command that makes “big” changes to a file (a | 415 | <description><p>Often times, when I run a vim command that makes “big” changes to a file (a macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> |
916 | macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> | ||
917 | |||
918 | <p><em>Save position with <code>winsaveview()</code>!</em></p> | 416 | <p><em>Save position with <code>winsaveview()</code>!</em></p> |
919 | 417 | <p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> that contains information about the view of the current window. This includes the cursor line number, cursor coloumn, the top most line in the window and a couple of other values, none of which concern us.</p> | |
920 | <p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> that contains information | 418 | <p>Before running our command (one that jumps around the buffer, a lot), we save our view, and restore it once its done, with <code>winrestview</code>.</p> |
921 | about the view of the current window. This includes the cursor line number, | ||
922 | cursor coloumn, the top most line in the window and a couple of other values, | ||
923 | none of which concern us.</p> | ||
924 | |||
925 | <p>Before running our command (one that jumps around the buffer, a lot), we save | ||
926 | our view, and restore it once its done, with <code>winrestview</code>.</p> | ||
927 | |||
928 | <pre><code>let view = winsaveview() | 419 | <pre><code>let view = winsaveview() |
929 | s/\s\+$//gc " find and (confirm) replace trailing blanks | 420 | s/\s\+$//gc " find and (confirm) replace trailing blanks |
930 | winrestview(view) " restore our original view! | 421 | winrestview(view) " restore our original view!</code></pre> |
931 | </code></pre> | 422 | <p>It might seem a little overkill in the above example, just use `` (double backticks) instead, but it comes in handy when you run your file through heavier filtering.</p></description> |
932 | |||
933 | <p>It might seem a little overkill in the above example, just use `` (double | ||
934 | backticks) instead, but it comes in handy when you run your file through | ||
935 | heavier filtering.</p></description> | ||
936 | <link>https://peppe.rs/posts/hold_position!/</link> | 423 | <link>https://peppe.rs/posts/hold_position!/</link> |
937 | <pubDate>Tue, 30 Jul 2019 12:31:00 +0000</pubDate> | 424 | <pubDate>Tue, 30 Jul 2019 12:31:00 +0000</pubDate> |
938 | <guid>https://peppe.rs/posts/hold_position!/</guid> | 425 | <guid>https://peppe.rs/posts/hold_position!/</guid> |
939 | </item> | 426 | </item> |
940 | <item> | 427 | <item> |
941 | <title>Get Better At Yanking And Putting In Vim</title> | 428 | <title>Get Better At Yanking And Putting In Vim</title> |
942 | <description><ol start="1"> | 429 | <description><p>a couple of nifty tricks to help you copy-paste better:</p> |
430 | <ol type="1"> | ||
943 | <li><p>reselecting previously selected text (i use this to fix botched selections):</p> | 431 | <li><p>reselecting previously selected text (i use this to fix botched selections):</p> |
944 | 432 | <pre><code>gv " :h gv for more | |
945 | <pre><code>gv " :h gv for more | 433 | " you can use `o` in visual mode to go to the `Other` end of the selection |
946 | " you can use `o` in visual mode to go to the `Other` end of the selection | 434 | " use a motion to fix the selection</code></pre></li> |
947 | " use a motion to fix the selection | ||
948 | </code></pre></li> | ||
949 | <li><p>reselecting previously yanked text:</p> | 435 | <li><p>reselecting previously yanked text:</p> |
950 | |||
951 | <pre><code>`[v`] | 436 | <pre><code>`[v`] |
952 | `[ " marks the beginning of the previously yanked text :h `[ | 437 | `[ " marks the beginning of the previously yanked text :h `[ |
953 | `] " marks the end :h `] | 438 | `] " marks the end :h `] |
954 | v " visual select everything in between | 439 | v " visual select everything in between |
955 | 440 | ||
956 | nnoremap gb `[v`] " "a quick map to perform the above | 441 | nnoremap gb `[v`] " "a quick map to perform the above</code></pre></li> |
957 | </code></pre></li> | ||
958 | <li><p>pasting and indenting text (in one go):</p> | 442 | <li><p>pasting and indenting text (in one go):</p> |
959 | 443 | <pre><code>]p " put (p) and adjust indent to current line | |
960 | <pre><code>]p " put (p) and adjust indent to current line | 444 | ]P " put the text before the cursor (P) and adjust indent to current line</code></pre></li> |
961 | ]P " put the text before the cursor (P) and adjust indent to current line | ||
962 | </code></pre></li> | ||
963 | </ol></description> | 445 | </ol></description> |
964 | <link>https://peppe.rs/posts/get_better_at_yanking_and_putting_in_vim/</link> | 446 | <link>https://peppe.rs/posts/get_better_at_yanking_and_putting_in_vim/</link> |
965 | <pubDate>Mon, 29 Jul 2019 12:31:00 +0000</pubDate> | 447 | <pubDate>Mon, 29 Jul 2019 12:31:00 +0000</pubDate> |
diff --git a/docs/posts/WPA_woes/index.html b/docs/posts/WPA_woes/index.html index f3fcfcf..0c50385 100644 --- a/docs/posts/WPA_woes/index.html +++ b/docs/posts/WPA_woes/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | WPA Woes | 38 | WPA Woes |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>I finally got around to installing Void GNU/Linux on my main computer. Rolling release, non-systemd, need I say more?</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>WPA_woes</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>I finally got around to installing Void GNU/Linux on my main computer. Rolling release, non-systemd, need I say more?</p> | ||
61 | <p>As with all GNU/Linux distributions, wireless networks had me in a fix. If you can see this post, it means I’ve managed to get online. It turns out, <code>wpa_supplicant</code> was detecting the wrong interface by default (does it ever select the right one?). Let us fix that:</p> | 42 | <p>As with all GNU/Linux distributions, wireless networks had me in a fix. If you can see this post, it means I’ve managed to get online. It turns out, <code>wpa_supplicant</code> was detecting the wrong interface by default (does it ever select the right one?). Let us fix that:</p> |
62 | <pre><code>$ sudo rm -r /var/service/wpa_supplicant | 43 | <pre><code>$ sudo rm -r /var/service/wpa_supplicant |
63 | $ sudo killall dhcpcd</code></pre> | 44 | $ sudo killall dhcpcd</code></pre> |
@@ -81,13 +62,15 @@ $ sudo ln -s /etc/sv/wpa_supplicant /var/service/ | |||
81 | $ sudo ln -s /etc/sv/dhcpcd /var/service/ | 62 | $ sudo ln -s /etc/sv/dhcpcd /var/service/ |
82 | $ sudo sv restart wpa_supplicant | 63 | $ sudo sv restart wpa_supplicant |
83 | $ sudo sv restart dhcpcd</code></pre> | 64 | $ sudo sv restart dhcpcd</code></pre> |
84 | </body> | ||
85 | </html> | ||
86 | 65 | ||
87 | </div> | 66 | </div> |
88 | 67 | ||
89 | <div class=intro> | 68 | <div class=intro> |
90 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 69 | Hi. |
70 | <div class=hot-links> | ||
71 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
72 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
73 | </div> | ||
91 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 74 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
92 | <p> | 75 | <p> |
93 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 76 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/bash_harder_with_vim/index.html b/docs/posts/bash_harder_with_vim/index.html index 17c066a..7c9e5d6 100644 --- a/docs/posts/bash_harder_with_vim/index.html +++ b/docs/posts/bash_harder_with_vim/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Bash Harder With Vim | 38 | Bash Harder With Vim |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>Bash is tricky, don’t let your editor get in your way. Here’s a couple of neat additions you could make to your <code>vimrc</code> for a better shell programming experience.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>bash_harder_with_vim</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>Bash is tricky, don’t let your editor get in your way. Here’s a couple of neat additions you could make to your <code>vimrc</code> for a better shell programming experience.</p> | ||
61 | <h3 id="man-pages-inside-vim">Man pages inside vim</h3> | 42 | <h3 id="man-pages-inside-vim">Man pages inside vim</h3> |
62 | <p>Source this script to get started:</p> | 43 | <p>Source this script to get started:</p> |
63 | <pre><code>runtime ftplugin/man.vim</code></pre> | 44 | <pre><code>runtime ftplugin/man.vim</code></pre> |
@@ -91,13 +72,15 @@ w | so % | |||
91 | <pre><code>$ vim | 72 | <pre><code>$ vim |
92 | New Post # output | 73 | New Post # output |
93 | Press ENTER or type command to continue</code></pre> | 74 | Press ENTER or type command to continue</code></pre> |
94 | </body> | ||
95 | </html> | ||
96 | 75 | ||
97 | </div> | 76 | </div> |
98 | 77 | ||
99 | <div class=intro> | 78 | <div class=intro> |
100 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 79 | Hi. |
80 | <div class=hot-links> | ||
81 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
82 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
83 | </div> | ||
101 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 84 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
102 | <p> | 85 | <p> |
103 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 86 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/bye_bye_BDFs/index.html b/docs/posts/bye_bye_BDFs/index.html index d7b7e46..a2e410d 100644 --- a/docs/posts/bye_bye_BDFs/index.html +++ b/docs/posts/bye_bye_BDFs/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,39 +38,21 @@ | |||
37 | Bye Bye BDFs | 38 | Bye Bye BDFs |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>Glyph Bitmap Distribution Format is no more, as the creators of <a href="https://pango.org">Pango</a>, one of the most widely used text rendering libraries, <a href="https://blogs.gnome.org/mclasen/2019/05/25/pango-future-directions/">announced</a> their plans for Pango 1.44.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>bye_bye_BDFs</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>Glyph Bitmap Distribution Format is no more, as the creators of <a href="https://pango.org">Pango</a>, one of the most widely used text rendering libraries, <a href="https://blogs.gnome.org/mclasen/2019/05/25/pango-future-directions/">announced</a> their plans for Pango 1.44.</p> | ||
61 | <p>Until recently, Pango used FreeType to draw fonts. They will be moving over to <a href="https://harfbuzz.org">Harfbuzz</a>, an evolution of FreeType.</p> | 42 | <p>Until recently, Pango used FreeType to draw fonts. They will be moving over to <a href="https://harfbuzz.org">Harfbuzz</a>, an evolution of FreeType.</p> |
62 | <p><em>Why?</em></p> | 43 | <p><em>Why?</em></p> |
63 | <p>In short, FreeType was hard to work with. It required complex logic, and provided no advantage over Harfbuzz (other than being able to fetch opentype metrics with ease).</p> | 44 | <p>In short, FreeType was hard to work with. It required complex logic, and provided no advantage over Harfbuzz (other than being able to fetch opentype metrics with ease).</p> |
64 | <p>Upgrading to Pango v1.44 will break your GTK applications (if you use a <code>bdf</code>/<code>pcf</code> bitmap font). Harfbuzz <em>does</em> support bitmap-only OpenType fonts, <code>otb</code>s. Convert your existing fonts over to <code>otb</code>s using <a href="https://fontforge.github.io">FontForge</a>. It is to be noted that applications such as <code>xterm</code> and <code>rxvt</code> use <code>xft</code> (X FreeType) to render fonts, and will remain unaffected by the update.</p> | 45 | <p>Upgrading to Pango v1.44 will break your GTK applications (if you use a <code>bdf</code>/<code>pcf</code> bitmap font). Harfbuzz <em>does</em> support bitmap-only OpenType fonts, <code>otb</code>s. Convert your existing fonts over to <code>otb</code>s using <a href="https://fontforge.github.io">FontForge</a>. It is to be noted that applications such as <code>xterm</code> and <code>rxvt</code> use <code>xft</code> (X FreeType) to render fonts, and will remain unaffected by the update.</p> |
65 | <p>Both <a href="https://github.com/nerdypepper/scientifica">scientifica</a> and <a href="https://github.com/nerdypepper/curie">curie</a> will soon ship with bitmap-only OpenType font formats.</p> | 46 | <p>Both <a href="https://github.com/nerdypepper/scientifica">scientifica</a> and <a href="https://github.com/nerdypepper/curie">curie</a> will soon ship with bitmap-only OpenType font formats.</p> |
66 | </body> | ||
67 | </html> | ||
68 | 47 | ||
69 | </div> | 48 | </div> |
70 | 49 | ||
71 | <div class=intro> | 50 | <div class=intro> |
72 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 51 | Hi. |
52 | <div class=hot-links> | ||
53 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
54 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
55 | </div> | ||
73 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 56 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
74 | <p> | 57 | <p> |
75 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 58 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/call_to_ARMs/index.html b/docs/posts/call_to_ARMs/index.html index 578a8b7..f882e6b 100644 --- a/docs/posts/call_to_ARMs/index.html +++ b/docs/posts/call_to_ARMs/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Call To ARMs | 38 | Call To ARMs |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>My 4th semester involves ARM programming. And proprietary tooling (Keil C). But we don’t do that here.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>call_to_ARMs</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>My 4th semester involves ARM programming. And proprietary tooling (Keil C). But we don’t do that here.</p> | ||
61 | <h3 id="building">Building</h3> | 42 | <h3 id="building">Building</h3> |
62 | <p>Assembling and linking ARM binaries on non-ARM architecture devices is fairly trivial. I went along with the GNU cross bare metal toolchain binutils, which provides <code>arm-as</code> and <code>arm-ld</code> (among a bunch of other utils that I don’t care about for now).</p> | 43 | <p>Assembling and linking ARM binaries on non-ARM architecture devices is fairly trivial. I went along with the GNU cross bare metal toolchain binutils, which provides <code>arm-as</code> and <code>arm-ld</code> (among a bunch of other utils that I don’t care about for now).</p> |
63 | <p>Assemble <code>.s</code> files with:</p> | 44 | <p>Assemble <code>.s</code> files with:</p> |
@@ -88,13 +69,15 @@ Reading symbols from main... # yay!</code></pre> | |||
88 | <p><a href="https://u.peppe.rs/wq.png"><img src="https://u.peppe.rs/wq.png" /></a></p> | 69 | <p><a href="https://u.peppe.rs/wq.png"><img src="https://u.peppe.rs/wq.png" /></a></p> |
89 | <h3 id="editing">Editing</h3> | 70 | <h3 id="editing">Editing</h3> |
90 | <p>Vim, with <code>syntax off</code> because it dosen’t handle GNU ARM syntax too well.</p> | 71 | <p>Vim, with <code>syntax off</code> because it dosen’t handle GNU ARM syntax too well.</p> |
91 | </body> | ||
92 | </html> | ||
93 | 72 | ||
94 | </div> | 73 | </div> |
95 | 74 | ||
96 | <div class=intro> | 75 | <div class=intro> |
97 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 76 | Hi. |
77 | <div class=hot-links> | ||
78 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
79 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
80 | </div> | ||
98 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 81 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
99 | <p> | 82 | <p> |
100 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 83 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/color_conundrum/index.html b/docs/posts/color_conundrum/index.html index f732fd0..0ba7aa5 100644 --- a/docs/posts/color_conundrum/index.html +++ b/docs/posts/color_conundrum/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Color Conundrum | 38 | Color Conundrum |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>This piece aims to highlight (pun intended) some of the reasons behind my <a href="https://u.peppe.rs/bF.png">color free</a> editor setup.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>color_conundrum</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>This piece aims to highlight (pun intended) some of the reasons behind my <a href="https://u.peppe.rs/bF.png">color free</a> editor setup.</p> | ||
61 | <p>Imagine highlighting an entire book because <em>all</em> of it is important. That is exactly what (most) syntax highlighting does. It is difficult for the human eye to filter out noise in rainbow barf. Use color to draw attention, not diverge it.</p> | 42 | <p>Imagine highlighting an entire book because <em>all</em> of it is important. That is exactly what (most) syntax highlighting does. It is difficult for the human eye to filter out noise in rainbow barf. Use color to draw attention, not diverge it.</p> |
62 | <p>At the same time, a book devoid of color is <em>boring!</em> What is the takeaway from this 10 line paragraph? What are the technical terms used?</p> | 43 | <p>At the same time, a book devoid of color is <em>boring!</em> What is the takeaway from this 10 line paragraph? What are the technical terms used?</p> |
63 | <p>Prose and code are certainly different, but the fickle minded human eye is the same. The eye constantly looks for a frame of reference, a focal point. It grows tired when it can’t find one.</p> | 44 | <p>Prose and code are certainly different, but the fickle minded human eye is the same. The eye constantly looks for a frame of reference, a focal point. It grows tired when it can’t find one.</p> |
@@ -65,13 +46,15 @@ | |||
65 | <p><a href="https://u.peppe.rs/lt.png"><img src="https://u.peppe.rs/lt.png" /></a></p> | 46 | <p><a href="https://u.peppe.rs/lt.png"><img src="https://u.peppe.rs/lt.png" /></a></p> |
66 | <p>Without highlighting (far left), it is hard to differentiate between comments and code! The florid color scheme (far right) is no good either, it contains too many attention grabbers. The center sample is a healthy balance of both. Function calls and constants stand out, and repetitive keywords and other noise (<code>let</code>, <code>as</code>) are mildly dimmed out. Comments and non-code text (sign column, status text) are dimmed further.</p> | 47 | <p>Without highlighting (far left), it is hard to differentiate between comments and code! The florid color scheme (far right) is no good either, it contains too many attention grabbers. The center sample is a healthy balance of both. Function calls and constants stand out, and repetitive keywords and other noise (<code>let</code>, <code>as</code>) are mildly dimmed out. Comments and non-code text (sign column, status text) are dimmed further.</p> |
67 | <p>I’ll stop myself before I rant about color contrast and combinations.</p> | 48 | <p>I’ll stop myself before I rant about color contrast and combinations.</p> |
68 | </body> | ||
69 | </html> | ||
70 | 49 | ||
71 | </div> | 50 | </div> |
72 | 51 | ||
73 | <div class=intro> | 52 | <div class=intro> |
74 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 53 | Hi. |
54 | <div class=hot-links> | ||
55 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
56 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
57 | </div> | ||
75 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 58 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
76 | <p> | 59 | <p> |
77 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 60 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/font_size_fallacies/index.html b/docs/posts/font_size_fallacies/index.html index f8bffad..c91eba5 100644 --- a/docs/posts/font_size_fallacies/index.html +++ b/docs/posts/font_size_fallacies/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Font Size Fallacies | 38 | Font Size Fallacies |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>I am not an expert with fonts, but I do have some experience <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, and common sense. This post aims to debunk some misconceptions about font sizes!</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>font_size_fallacies</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>I am not an expert with fonts, but I do have some experience <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, and common sense. This post aims to debunk some misconceptions about font sizes!</p> | ||
61 | <p>11 px on your display is <em>probably not</em> 11 px on my display. Let’s do some quick math. I have two displays, 1366x768 @ 21" and another with 1920x1080 @ 13", call them <code>A</code> and <code>B</code> for now.</p> | 42 | <p>11 px on your display is <em>probably not</em> 11 px on my display. Let’s do some quick math. I have two displays, 1366x768 @ 21" and another with 1920x1080 @ 13", call them <code>A</code> and <code>B</code> for now.</p> |
62 | <p>Display <code>A</code> has 1,049,088 pixels. A pixel is a square, of side say, <code>s</code> cm. The total area covered by my 21" display is about 1,066 cm^2 (41x26). Thus,</p> | 43 | <p>Display <code>A</code> has 1,049,088 pixels. A pixel is a square, of side say, <code>s</code> cm. The total area covered by my 21" display is about 1,066 cm^2 (41x26). Thus,</p> |
63 | <pre><code>Display A | 44 | <pre><code>Display A |
@@ -87,13 +68,15 @@ Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm) | |||
87 | <li id="fn4" role="doc-endnote"><p>https://en.wikipedia.org/wiki/Sony_Xperia_1<a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | 68 | <li id="fn4" role="doc-endnote"><p>https://en.wikipedia.org/wiki/Sony_Xperia_1<a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
88 | </ol> | 69 | </ol> |
89 | </section> | 70 | </section> |
90 | </body> | ||
91 | </html> | ||
92 | 71 | ||
93 | </div> | 72 | </div> |
94 | 73 | ||
95 | <div class=intro> | 74 | <div class=intro> |
96 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 75 | Hi. |
76 | <div class=hot-links> | ||
77 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
78 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
79 | </div> | ||
97 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 80 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
98 | <p> | 81 | <p> |
99 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 82 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/get_better_at_yanking_and_putting_in_vim/index.html b/docs/posts/get_better_at_yanking_and_putting_in_vim/index.html index 6536f6d..a009a15 100644 --- a/docs/posts/get_better_at_yanking_and_putting_in_vim/index.html +++ b/docs/posts/get_better_at_yanking_and_putting_in_vim/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Get Better At Yanking And Putting In Vim | 38 | Get Better At Yanking And Putting In Vim |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>a couple of nifty tricks to help you copy-paste better:</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>get_better_at_yanking_and_putting_in_vim</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>a couple of nifty tricks to help you copy-paste better:</p> | ||
61 | <ol type="1"> | 42 | <ol type="1"> |
62 | <li><p>reselecting previously selected text (i use this to fix botched selections):</p> | 43 | <li><p>reselecting previously selected text (i use this to fix botched selections):</p> |
63 | <pre><code>gv " :h gv for more | 44 | <pre><code>gv " :h gv for more |
@@ -74,13 +55,15 @@ nnoremap gb `[v`] " "a quick map to perform the above</code></pre>< | |||
74 | <pre><code>]p " put (p) and adjust indent to current line | 55 | <pre><code>]p " put (p) and adjust indent to current line |
75 | ]P " put the text before the cursor (P) and adjust indent to current line</code></pre></li> | 56 | ]P " put the text before the cursor (P) and adjust indent to current line</code></pre></li> |
76 | </ol> | 57 | </ol> |
77 | </body> | ||
78 | </html> | ||
79 | 58 | ||
80 | </div> | 59 | </div> |
81 | 60 | ||
82 | <div class=intro> | 61 | <div class=intro> |
83 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 62 | Hi. |
63 | <div class=hot-links> | ||
64 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
65 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
66 | </div> | ||
84 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 67 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
85 | <p> | 68 | <p> |
86 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 69 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/hold_position!/index.html b/docs/posts/hold_position!/index.html index b14d41a..61e4768 100644 --- a/docs/posts/hold_position!/index.html +++ b/docs/posts/hold_position!/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Hold Position! | 38 | Hold Position! |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>Often times, when I run a vim command that makes “big” changes to a file (a macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>hold_position!</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>Often times, when I run a vim command that makes “big” changes to a file (a macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> | ||
61 | <p><em>Save position with <code>winsaveview()</code>!</em></p> | 42 | <p><em>Save position with <code>winsaveview()</code>!</em></p> |
62 | <p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> that contains information about the view of the current window. This includes the cursor line number, cursor coloumn, the top most line in the window and a couple of other values, none of which concern us.</p> | 43 | <p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> that contains information about the view of the current window. This includes the cursor line number, cursor coloumn, the top most line in the window and a couple of other values, none of which concern us.</p> |
63 | <p>Before running our command (one that jumps around the buffer, a lot), we save our view, and restore it once its done, with <code>winrestview</code>.</p> | 44 | <p>Before running our command (one that jumps around the buffer, a lot), we save our view, and restore it once its done, with <code>winrestview</code>.</p> |
@@ -65,13 +46,15 @@ | |||
65 | s/\s\+$//gc " find and (confirm) replace trailing blanks | 46 | s/\s\+$//gc " find and (confirm) replace trailing blanks |
66 | winrestview(view) " restore our original view!</code></pre> | 47 | winrestview(view) " restore our original view!</code></pre> |
67 | <p>It might seem a little overkill in the above example, just use `` (double backticks) instead, but it comes in handy when you run your file through heavier filtering.</p> | 48 | <p>It might seem a little overkill in the above example, just use `` (double backticks) instead, but it comes in handy when you run your file through heavier filtering.</p> |
68 | </body> | ||
69 | </html> | ||
70 | 49 | ||
71 | </div> | 50 | </div> |
72 | 51 | ||
73 | <div class=intro> | 52 | <div class=intro> |
74 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 53 | Hi. |
54 | <div class=hot-links> | ||
55 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
56 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
57 | </div> | ||
75 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 58 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
76 | <p> | 59 | <p> |
77 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 60 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/my_setup/index.html b/docs/posts/my_setup/index.html index aaad548..996a459 100644 --- a/docs/posts/my_setup/index.html +++ b/docs/posts/my_setup/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,39 +38,21 @@ | |||
37 | My Setup | 38 | My Setup |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>Decided to do one of these because everyone does one of these.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>my_setup</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>Decided to do one of these because everyone does one of these.</p> | ||
61 | <p><img src="https://u.peppe.rs/Hb.png" /></p> | 42 | <p><img src="https://u.peppe.rs/Hb.png" /></p> |
62 | <p>My entire setup is managed with GNU <code>stow</code>, making it easier to replicate on fresh installations. You can find my configuration files on <a href="https://github.com/nerdypepper">GitHub</a>.</p> | 43 | <p>My entire setup is managed with GNU <code>stow</code>, making it easier to replicate on fresh installations. You can find my configuration files on <a href="https://github.com/nerdypepper">GitHub</a>.</p> |
63 | <p>I run Void Linux (glibc) on my <a href="https://store.hp.com/us/en/mdp/laptops/envy-13">HP Envy 13" (2018)</a>. To keep things simple, I run a raw X session with <code>2bwm</code> as my window manager, along with <code>dunst</code> (notification daemon) and Sam’s <a href="https://github.com/sdhand/compton"><code>compton</code></a> (compositor) fork.</p> | 44 | <p>I run Void Linux (glibc) on my <a href="https://store.hp.com/us/en/mdp/laptops/envy-13">HP Envy 13" (2018)</a>. To keep things simple, I run a raw X session with <code>2bwm</code> as my window manager, along with <code>dunst</code> (notification daemon) and Sam’s <a href="https://github.com/sdhand/compton"><code>compton</code></a> (compositor) fork.</p> |
64 | <p>I am a fan of GNU tools, so I use <code>bash</code> as my shell, and <code>coreutils</code> to manage files, archives, strings, paths etc. I edit files with <code>vim</code>, chat with <code>weechat</code>, listen to music with <code>cmus</code>, monitor processes with <code>htop</code>, manage sessions with <code>tmux</code>, read pdfs in <code>zathura</code>. I rarely ever leave the comfort of my terminal emulator, <code>urxvt</code>.</p> | 45 | <p>I am a fan of GNU tools, so I use <code>bash</code> as my shell, and <code>coreutils</code> to manage files, archives, strings, paths etc. I edit files with <code>vim</code>, chat with <code>weechat</code>, listen to music with <code>cmus</code>, monitor processes with <code>htop</code>, manage sessions with <code>tmux</code>, read pdfs in <code>zathura</code>. I rarely ever leave the comfort of my terminal emulator, <code>urxvt</code>.</p> |
65 | <p>Most of my academic typesetting is done with TeX, and compiled with <code>xelatex</code>. Other <em>fun</em> documents are made with GIMP :).</p> | 46 | <p>Most of my academic typesetting is done with TeX, and compiled with <code>xelatex</code>. Other <em>fun</em> documents are made with GIMP :).</p> |
66 | </body> | ||
67 | </html> | ||
68 | 47 | ||
69 | </div> | 48 | </div> |
70 | 49 | ||
71 | <div class=intro> | 50 | <div class=intro> |
72 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 51 | Hi. |
52 | <div class=hot-links> | ||
53 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
54 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
55 | </div> | ||
73 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 56 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
74 | <p> | 57 | <p> |
75 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 58 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/onivim_sucks/index.html b/docs/posts/onivim_sucks/index.html index 9635c8c..ded6fd9 100644 --- a/docs/posts/onivim_sucks/index.html +++ b/docs/posts/onivim_sucks/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,38 +38,20 @@ | |||
37 | Onivim Sucks | 38 | Onivim Sucks |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p><a href="https://v2.onivim.io">Onivim</a> is a ‘modern modal editor’, combining fancy interface and language features with vim-style modal editing. What’s wrong you ask?</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>onivim_sucks</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p><a href="https://v2.onivim.io">Onivim</a> is a ‘modern modal editor’, combining fancy interface and language features with vim-style modal editing. What’s wrong you ask?</p> | ||
61 | <p>Apart from <a href="https://github.com/onivim/oni2/issues/550">buggy syntax highlighting</a>, <a href="https://github.com/onivim/oni2/issues/519">broken scrolling</a> and <a href="https://github.com/onivim/oni2/issues?q=is%3Aissue+label%3A%22daily+editor+blocker%22+is%3Aopen">others</a>, Onivim is <strong>proprietary</strong> software. It is licensed under a commercial <a href="https://github.com/onivim/oni1/blob/master/Outrun-Labs-EULA-v1.1.md">end user agreement license</a>, which prohibits redistribution in both object code and source code formats.</p> | 42 | <p>Apart from <a href="https://github.com/onivim/oni2/issues/550">buggy syntax highlighting</a>, <a href="https://github.com/onivim/oni2/issues/519">broken scrolling</a> and <a href="https://github.com/onivim/oni2/issues?q=is%3Aissue+label%3A%22daily+editor+blocker%22+is%3Aopen">others</a>, Onivim is <strong>proprietary</strong> software. It is licensed under a commercial <a href="https://github.com/onivim/oni1/blob/master/Outrun-Labs-EULA-v1.1.md">end user agreement license</a>, which prohibits redistribution in both object code and source code formats.</p> |
62 | <p>Onivim’s core editor logic (bits that belong to vim), have been separated from the interface, into <a href="https://github.com/onivim/libvim">libvim</a>. libvim is licensed under MIT, which means, this ‘extension’ of vim is perfectly in adherence to <a href="http://vimdoc.sourceforge.net/htmldoc/uganda.html#license">vim’s license text</a>! Outrun Labs are exploiting this loophole (distributing vim as a library) to commercialize Onivim.</p> | 43 | <p>Onivim’s core editor logic (bits that belong to vim), have been separated from the interface, into <a href="https://github.com/onivim/libvim">libvim</a>. libvim is licensed under MIT, which means, this ‘extension’ of vim is perfectly in adherence to <a href="http://vimdoc.sourceforge.net/htmldoc/uganda.html#license">vim’s license text</a>! Outrun Labs are exploiting this loophole (distributing vim as a library) to commercialize Onivim.</p> |
63 | <p>Onivim’s source code is available on <a href="https://github.com/onivim/oni2">GitHub</a>. They do mention that the source code trickles down to the <a href="https://github.com/onivim/oni2-mit">oni2-mit</a> repository, which (not yet) contains MIT-licensed code, <strong>18 months</strong> after each commit to the original repository.</p> | 44 | <p>Onivim’s source code is available on <a href="https://github.com/onivim/oni2">GitHub</a>. They do mention that the source code trickles down to the <a href="https://github.com/onivim/oni2-mit">oni2-mit</a> repository, which (not yet) contains MIT-licensed code, <strong>18 months</strong> after each commit to the original repository.</p> |
64 | <p>Want to contribute to Onivim? Don’t. They make a profit out of your contributions. Currently, Onivim is priced at $19.99, ‘pre-alpha’ pricing which is 80% off the final price! If you are on the lookout for an editor, I would suggest using <a href="https://vim.org">Vim</a>, charity ware that actually works, and costs $100 lesser.</p> | 45 | <p>Want to contribute to Onivim? Don’t. They make a profit out of your contributions. Currently, Onivim is priced at $19.99, ‘pre-alpha’ pricing which is 80% off the final price! If you are on the lookout for an editor, I would suggest using <a href="https://vim.org">Vim</a>, charity ware that actually works, and costs $100 lesser.</p> |
65 | </body> | ||
66 | </html> | ||
67 | 46 | ||
68 | </div> | 47 | </div> |
69 | 48 | ||
70 | <div class=intro> | 49 | <div class=intro> |
71 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 50 | Hi. |
51 | <div class=hot-links> | ||
52 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
53 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
54 | </div> | ||
72 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 55 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
73 | <p> | 56 | <p> |
74 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 57 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/pixel_art_in_GIMP/index.html b/docs/posts/pixel_art_in_GIMP/index.html index 7bd1eed..e6661b2 100644 --- a/docs/posts/pixel_art_in_GIMP/index.html +++ b/docs/posts/pixel_art_in_GIMP/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Pixel Art In GIMP | 38 | Pixel Art In GIMP |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>I’ve always been an admirer of pixel art, because of it’s simplicity and it’s resemblance to bitmap font design. Recently, I decided to take the dive and make some art of my own.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>pixel_art_in_GIMP</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>I’ve always been an admirer of pixel art, because of it’s simplicity and it’s resemblance to bitmap font design. Recently, I decided to take the dive and make some art of my own.</p> | ||
61 | <p>I used GIMP because I am fairly familiar with it. Aseprite seems to be the editor of choice for animated pixel art though.</p> | 42 | <p>I used GIMP because I am fairly familiar with it. Aseprite seems to be the editor of choice for animated pixel art though.</p> |
62 | <h3 id="setting-up-the-canvas">Setting up the canvas</h3> | 43 | <h3 id="setting-up-the-canvas">Setting up the canvas</h3> |
63 | <p>Picking a canvas size is daunting. Too small, and you won’t be able to fit in enough detail to make a legible piece. Too big and you’ve got too many pixels to work with!</p> | 44 | <p>Picking a canvas size is daunting. Too small, and you won’t be able to fit in enough detail to make a legible piece. Too big and you’ve got too many pixels to work with!</p> |
@@ -106,13 +87,15 @@ | |||
106 | <p><img src="https://u.peppe.rs/cn.png" /></p> | 87 | <p><img src="https://u.peppe.rs/cn.png" /></p> |
107 | <p>Hold on, why is it so tiny? Well, that’s because our canvas was 100x100, head over to <code>Image > Scale Image</code>, set <code>Quality > Interpolation</code> to <code>None</code> and scale it up to 700x700, et voilà!</p> | 88 | <p>Hold on, why is it so tiny? Well, that’s because our canvas was 100x100, head over to <code>Image > Scale Image</code>, set <code>Quality > Interpolation</code> to <code>None</code> and scale it up to 700x700, et voilà!</p> |
108 | <p><img src="https://u.peppe.rs/CH.png" /></p> | 89 | <p><img src="https://u.peppe.rs/CH.png" /></p> |
109 | </body> | ||
110 | </html> | ||
111 | 90 | ||
112 | </div> | 91 | </div> |
113 | 92 | ||
114 | <div class=intro> | 93 | <div class=intro> |
115 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 94 | Hi. |
95 | <div class=hot-links> | ||
96 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
97 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
98 | </div> | ||
116 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 99 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
117 | <p> | 100 | <p> |
118 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 101 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/rapid_refactoring_with_vim/index.html b/docs/posts/rapid_refactoring_with_vim/index.html index 36d06fc..c5bc188 100644 --- a/docs/posts/rapid_refactoring_with_vim/index.html +++ b/docs/posts/rapid_refactoring_with_vim/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,71 +38,7 @@ | |||
37 | Rapid Refactoring With Vim | 38 | Rapid Refactoring With Vim |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>Last weekend, I was tasked with refactoring the 96 unit tests on <a href="https://github.com/ruma/ruma-events/pull/70">ruma-events</a> to use strictly typed json objects using <code>serde_json::json!</code> instead of raw strings. It was rather painless thanks to vim :)</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>rapid_refactoring_with_vim</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | pre > code.sourceCode { white-space: pre; position: relative; } | ||
55 | pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } | ||
56 | pre > code.sourceCode > span:empty { height: 1.2em; } | ||
57 | code.sourceCode > span { color: inherit; text-decoration: inherit; } | ||
58 | div.sourceCode { margin: 1em 0; } | ||
59 | pre.sourceCode { margin: 0; } | ||
60 | @media screen { | ||
61 | div.sourceCode { overflow: auto; } | ||
62 | } | ||
63 | @media print { | ||
64 | pre > code.sourceCode { white-space: pre-wrap; } | ||
65 | pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } | ||
66 | } | ||
67 | pre.numberSource code | ||
68 | { counter-reset: source-line 0; } | ||
69 | pre.numberSource code > span | ||
70 | { position: relative; left: -4em; counter-increment: source-line; } | ||
71 | pre.numberSource code > span > a:first-child::before | ||
72 | { content: counter(source-line); | ||
73 | position: relative; left: -1em; text-align: right; vertical-align: baseline; | ||
74 | border: none; display: inline-block; | ||
75 | -webkit-touch-callout: none; -webkit-user-select: none; | ||
76 | -khtml-user-select: none; -moz-user-select: none; | ||
77 | -ms-user-select: none; user-select: none; | ||
78 | padding: 0 4px; width: 4em; | ||
79 | } | ||
80 | pre.numberSource { margin-left: 3em; padding-left: 4px; } | ||
81 | div.sourceCode | ||
82 | { } | ||
83 | @media screen { | ||
84 | pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } | ||
85 | } | ||
86 | code span.al { font-weight: bold; } /* Alert */ | ||
87 | code span.an { font-style: italic; } /* Annotation */ | ||
88 | code span.cf { font-weight: bold; } /* ControlFlow */ | ||
89 | code span.co { font-style: italic; } /* Comment */ | ||
90 | code span.cv { font-style: italic; } /* CommentVar */ | ||
91 | code span.do { font-style: italic; } /* Documentation */ | ||
92 | code span.dt { text-decoration: underline; } /* DataType */ | ||
93 | code span.er { font-weight: bold; } /* Error */ | ||
94 | code span.in { font-style: italic; } /* Information */ | ||
95 | code span.kw { font-weight: bold; } /* Keyword */ | ||
96 | code span.pp { font-weight: bold; } /* Preprocessor */ | ||
97 | code span.wa { font-style: italic; } /* Warning */ | ||
98 | </style> | ||
99 | <!--[if lt IE 9]> | ||
100 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
101 | <![endif]--> | ||
102 | </head> | ||
103 | <body> | ||
104 | <p>Last weekend, I was tasked with refactoring the 96 unit tests on <a href="https://github.com/ruma/ruma-events/pull/70">ruma-events</a> to use strictly typed json objects using <code>serde_json::json!</code> instead of raw strings. It was rather painless thanks to vim :)</p> | ||
105 | <p>Here’s a small sample of what had to be done (note the lines prefixed with the arrow):</p> | 42 | <p>Here’s a small sample of what had to be done (note the lines prefixed with the arrow):</p> |
106 | <div class="sourceCode" id="cb1"><pre class="sourceCode rust"><code class="sourceCode rust"><span id="cb1-1"><a href="#cb1-1"></a>→ <span class="kw">use</span> <span class="pp">serde_json::</span><span class="op">{</span>from_str<span class="op">};</span></span> | 43 | <div class="sourceCode" id="cb1"><pre class="sourceCode rust"><code class="sourceCode rust"><span id="cb1-1"><a href="#cb1-1"></a>→ <span class="kw">use</span> <span class="pp">serde_json::</span><span class="op">{</span>from_str<span class="op">};</span></span> |
107 | <span id="cb1-2"><a href="#cb1-2"></a> </span> | 44 | <span id="cb1-2"><a href="#cb1-2"></a> </span> |
@@ -190,13 +127,15 @@ BUFFER: json!( ... );</code></pre> | |||
190 | <li id="fn4" role="doc-endnote"><p><code>:help mark-motions</code><a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li> | 127 | <li id="fn4" role="doc-endnote"><p><code>:help mark-motions</code><a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li> |
191 | </ol> | 128 | </ol> |
192 | </section> | 129 | </section> |
193 | </body> | ||
194 | </html> | ||
195 | 130 | ||
196 | </div> | 131 | </div> |
197 | 132 | ||
198 | <div class=intro> | 133 | <div class=intro> |
199 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 134 | Hi. |
135 | <div class=hot-links> | ||
136 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
137 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
138 | </div> | ||
200 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 139 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
201 | <p> | 140 | <p> |
202 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 141 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/static_sites_with_bash/index.html b/docs/posts/static_sites_with_bash/index.html index fff53dc..67eaf12 100644 --- a/docs/posts/static_sites_with_bash/index.html +++ b/docs/posts/static_sites_with_bash/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,71 +38,7 @@ | |||
37 | Static Sites With Bash | 38 | Static Sites With Bash |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>After going through a bunch of static site generators (<a href="https://blog.getpelican.com/">pelican</a>, <a href="https://gohugo.io">hugo</a>, <a href="https://github.com/icyphox/vite">vite</a>), I decided to roll my own. If you are more of the ‘show me the code’ kinda guy, <a href="https://github.com/nerdypepper/site">here</a> you go.</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>static_sites_with_bash</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | pre > code.sourceCode { white-space: pre; position: relative; } | ||
55 | pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } | ||
56 | pre > code.sourceCode > span:empty { height: 1.2em; } | ||
57 | code.sourceCode > span { color: inherit; text-decoration: inherit; } | ||
58 | div.sourceCode { margin: 1em 0; } | ||
59 | pre.sourceCode { margin: 0; } | ||
60 | @media screen { | ||
61 | div.sourceCode { overflow: auto; } | ||
62 | } | ||
63 | @media print { | ||
64 | pre > code.sourceCode { white-space: pre-wrap; } | ||
65 | pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } | ||
66 | } | ||
67 | pre.numberSource code | ||
68 | { counter-reset: source-line 0; } | ||
69 | pre.numberSource code > span | ||
70 | { position: relative; left: -4em; counter-increment: source-line; } | ||
71 | pre.numberSource code > span > a:first-child::before | ||
72 | { content: counter(source-line); | ||
73 | position: relative; left: -1em; text-align: right; vertical-align: baseline; | ||
74 | border: none; display: inline-block; | ||
75 | -webkit-touch-callout: none; -webkit-user-select: none; | ||
76 | -khtml-user-select: none; -moz-user-select: none; | ||
77 | -ms-user-select: none; user-select: none; | ||
78 | padding: 0 4px; width: 4em; | ||
79 | } | ||
80 | pre.numberSource { margin-left: 3em; padding-left: 4px; } | ||
81 | div.sourceCode | ||
82 | { } | ||
83 | @media screen { | ||
84 | pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } | ||
85 | } | ||
86 | code span.al { font-weight: bold; } /* Alert */ | ||
87 | code span.an { font-style: italic; } /* Annotation */ | ||
88 | code span.cf { font-weight: bold; } /* ControlFlow */ | ||
89 | code span.co { font-style: italic; } /* Comment */ | ||
90 | code span.cv { font-style: italic; } /* CommentVar */ | ||
91 | code span.do { font-style: italic; } /* Documentation */ | ||
92 | code span.dt { text-decoration: underline; } /* DataType */ | ||
93 | code span.er { font-weight: bold; } /* Error */ | ||
94 | code span.in { font-style: italic; } /* Information */ | ||
95 | code span.kw { font-weight: bold; } /* Keyword */ | ||
96 | code span.pp { font-weight: bold; } /* Preprocessor */ | ||
97 | code span.wa { font-style: italic; } /* Warning */ | ||
98 | </style> | ||
99 | <!--[if lt IE 9]> | ||
100 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
101 | <![endif]--> | ||
102 | </head> | ||
103 | <body> | ||
104 | <p>After going through a bunch of static site generators (<a href="https://blog.getpelican.com/">pelican</a>, <a href="https://gohugo.io">hugo</a>, <a href="https://github.com/icyphox/vite">vite</a>), I decided to roll my own. If you are more of the ‘show me the code’ kinda guy, <a href="https://github.com/nerdypepper/site">here</a> you go.</p> | ||
105 | <h3 id="text-formatting">Text formatting</h3> | 42 | <h3 id="text-formatting">Text formatting</h3> |
106 | <p>I chose to write in markdown, and convert to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p> | 43 | <p>I chose to write in markdown, and convert to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p> |
107 | <h3 id="directory-structure">Directory structure</h3> | 44 | <h3 id="directory-structure">Directory structure</h3> |
@@ -128,13 +65,15 @@ | |||
128 | <span id="cb2-10"><a href="#cb2-10"></a><span class="bu">echo</span> <span class="st">"https://u.peppe.rs/</span><span class="va">$id</span><span class="st">"</span></span></code></pre></div> | 65 | <span id="cb2-10"><a href="#cb2-10"></a><span class="bu">echo</span> <span class="st">"https://u.peppe.rs/</span><span class="va">$id</span><span class="st">"</span></span></code></pre></div> |
129 | <h3 id="templating">Templating</h3> | 66 | <h3 id="templating">Templating</h3> |
130 | <p><a href="https://github.com/NerdyPepper/site/blob/master/generate.sh"><code>generate.sh</code></a> brings the above bits and pieces together (with some extra cruft to avoid javascript). It uses <code>sed</code> to produce nice titles from the file names (removes underscores, title-case), and <code>date(1)</code> to add the date to each post listing!</p> | 67 | <p><a href="https://github.com/NerdyPepper/site/blob/master/generate.sh"><code>generate.sh</code></a> brings the above bits and pieces together (with some extra cruft to avoid javascript). It uses <code>sed</code> to produce nice titles from the file names (removes underscores, title-case), and <code>date(1)</code> to add the date to each post listing!</p> |
131 | </body> | ||
132 | </html> | ||
133 | 68 | ||
134 | </div> | 69 | </div> |
135 | 70 | ||
136 | <div class=intro> | 71 | <div class=intro> |
137 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 72 | Hi. |
73 | <div class=hot-links> | ||
74 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
75 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
76 | </div> | ||
138 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 77 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
139 | <p> | 78 | <p> |
140 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 79 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |
diff --git a/docs/posts/termux_tandem/index.html b/docs/posts/termux_tandem/index.html index a2aba29..b4818cf 100644 --- a/docs/posts/termux_tandem/index.html +++ b/docs/posts/termux_tandem/index.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | <head> | 3 | <head> |
4 | <link rel="stylesheet" href="/style.css"> | 4 | <link rel="stylesheet" href="/style.css"> |
5 | <link rel="stylesheet" href="/syntax.css"> | ||
5 | <meta charset="UTF-8"> | 6 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="initial-scale=1"> | 7 | <meta name="viewport" content="initial-scale=1"> |
7 | <meta content="#ffffff" name="theme-color"> | 8 | <meta content="#ffffff" name="theme-color"> |
@@ -37,27 +38,7 @@ | |||
37 | Termux Tandem | 38 | Termux Tandem |
38 | </h1> | 39 | </h1> |
39 | <div class="post-text"> | 40 | <div class="post-text"> |
40 | <!DOCTYPE html> | 41 | <p>I learnt about <code>termux</code> from a friend on IRC recently. It looked super gimmicky to me at first, but it eventually proved to be useful. Here’s what I use it for:</p> |
41 | <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> | ||
42 | <head> | ||
43 | <meta charset="utf-8" /> | ||
44 | <meta name="generator" content="pandoc" /> | ||
45 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
46 | <title>termux_tandem</title> | ||
47 | <style> | ||
48 | code{white-space: pre-wrap;} | ||
49 | span.smallcaps{font-variant: small-caps;} | ||
50 | span.underline{text-decoration: underline;} | ||
51 | div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
52 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
53 | ul.task-list{list-style: none;} | ||
54 | </style> | ||
55 | <!--[if lt IE 9]> | ||
56 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
57 | <![endif]--> | ||
58 | </head> | ||
59 | <body> | ||
60 | <p>I learnt about <code>termux</code> from a friend on IRC recently. It looked super gimmicky to me at first, but it eventually proved to be useful. Here’s what I use it for:</p> | ||
61 | <h3 id="rsync">rsync</h3> | 42 | <h3 id="rsync">rsync</h3> |
62 | <p>Ever since I degoogled my android device, syncing files between my phone and my PC has always been a pain. I’m looking at you MTP. But, with <code>termux</code> and <code>sshd</code> all set up, it’s as simple as:</p> | 43 | <p>Ever since I degoogled my android device, syncing files between my phone and my PC has always been a pain. I’m looking at you MTP. But, with <code>termux</code> and <code>sshd</code> all set up, it’s as simple as:</p> |
63 | <pre><code>$ arp | 44 | <pre><code>$ arp |
@@ -75,13 +56,15 @@ mtZabXG.jpg p8d5c584f2841.jpg vjUxGjq.jpg</code></pre> | |||
75 | <h3 id="cmus">cmus</h3> | 56 | <h3 id="cmus">cmus</h3> |
76 | <p>Alright, I don’t really listen to music via <code>cmus</code>, but I did use it a couple times when my default music player was acting up. <code>cmus</code> is a viable option:</p> | 57 | <p>Alright, I don’t really listen to music via <code>cmus</code>, but I did use it a couple times when my default music player was acting up. <code>cmus</code> is a viable option:</p> |
77 | <p><a href="https://u.peppe.rs/CP.jpg"><img src="https://u.peppe.rs/CP.jpg" /></a></p> | 58 | <p><a href="https://u.peppe.rs/CP.jpg"><img src="https://u.peppe.rs/CP.jpg" /></a></p> |
78 | </body> | ||
79 | </html> | ||
80 | 59 | ||
81 | </div> | 60 | </div> |
82 | 61 | ||
83 | <div class=intro> | 62 | <div class=intro> |
84 | Hi. <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | 63 | Hi. |
64 | <div class=hot-links> | ||
65 | <a href=https://peppe.rs/index.xml class=feed-button>Subscribe</a> | ||
66 | <a href=https://liberapay.com/nerdypepper/donate class=donate-button>Donate</a> | ||
67 | </div> | ||
85 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> | 68 | <p>I'm Akshay, I go by nerd or nerdypepper on the internet.</p> |
86 | <p> | 69 | <p> |
87 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. | 70 | I am a compsci undergrad, Rust programmer and an enthusiastic Vimmer. |