aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/index.xml100
1 files changed, 50 insertions, 50 deletions
diff --git a/docs/index.xml b/docs/index.xml
index 91bd033..c892fb6 100644
--- a/docs/index.xml
+++ b/docs/index.xml
@@ -45,7 +45,7 @@ Pencil Tool (<code>n</code> on the keyboard) for hard edge drawings.
45Here&#39;s a small comparison if you don&#39;t know the difference 45Here&#39;s a small comparison if you don&#39;t know the difference
46between a hard edge and a soft edge:</p> 46between a hard edge and a soft edge:</p>
47 47
48<p><img src="https://u.peppe.rs/kz.png" alt="hard edge vs soft edge" /></p> 48<p><img src="https://u.peppe.rs/kz.png" alt="Hard edge vs Soft Edge" /></p>
49 49
50<p>I turn the size down all the way to 1 (<code>[</code> on the keyboard). 50<p>I turn the size down all the way to 1 (<code>[</code> on the keyboard).
51Set <code>Dynamics</code> off. <a href="https://u.peppe.rs/Fs.png">Here&#8217;s</a> a 51Set <code>Dynamics</code> off. <a href="https://u.peppe.rs/Fs.png">Here&#8217;s</a> a
@@ -79,14 +79,14 @@ merge it with the original.</p>
79 79
80<p>Your outline might look something like this:</p> 80<p>Your outline might look something like this:</p>
81 81
82<p><img src="https://u.peppe.rs/mn.png" alt="rice_outline" /></p> 82<p><img src="https://u.peppe.rs/mn.png" alt="" /></p>
83 83
84<p>Go ahead and fill it in with the fill tool (<code>Shift + b</code> on 84<p>Go ahead and fill it in with the fill tool (<code>Shift + b</code> on
85the keyboard), add in some seaweed as well, preferably on a 85the keyboard), add in some seaweed as well, preferably on a
86different layer. You can toggle symmetry on and off to save 86different layer. You can toggle symmetry on and off to save
87yourself some time.</p> 87yourself some time.</p>
88 88
89<p><img src="https://u.peppe.rs/xu.png" alt="with_seaweed" /></p> 89<p><img src="https://u.peppe.rs/xu.png" alt="" /></p>
90 90
91<h4 id="Shadows">Shadows</h4> 91<h4 id="Shadows">Shadows</h4>
92 92
@@ -97,7 +97,7 @@ surface later.</p>
97<p>Shadows on any surface always follow the shape of the 97<p>Shadows on any surface always follow the shape of the
98surface. A spherical onigiri would have a circular shadow:</p> 98surface. A spherical onigiri would have a circular shadow:</p>
99 99
100<p><img src="https://u.peppe.rs/FU.png" alt="riceball_shadow" /></p> 100<p><img src="https://u.peppe.rs/FU.png" alt="" /></p>
101 101
102<p>A couple of noticeable changes:</p> 102<p>A couple of noticeable changes:</p>
103 103
@@ -112,7 +112,7 @@ edges). </p>
112filling in that area with another, darker shadow! An image 112filling in that area with another, darker shadow! An image
113might explain better:</p> 113might explain better:</p>
114 114
115<p><img src="https://u.peppe.rs/Br.png" alt="shadow_all" /></p> 115<p><img src="https://u.peppe.rs/Br.png" alt="" /></p>
116 116
117<p>To emulate soft lights, reduce the value by 2 to 3 points 117<p>To emulate soft lights, reduce the value by 2 to 3 points
118every iteration. Notice how area <code>1</code> is much larger than 118every iteration. Notice how area <code>1</code> is much larger than
@@ -125,7 +125,7 @@ light than areas <code>3</code> and <code>4</code>.</p>
125flatter object, doesn&#39;t cast much of a shadow, so stop with 125flatter object, doesn&#39;t cast much of a shadow, so stop with
1261 or 2 iterations of the gradient:</p> 1261 or 2 iterations of the gradient:</p>
127 127
128<p><img src="https://u.peppe.rs/T3.png" alt="shadow_weed" /></p> 128<p><img src="https://u.peppe.rs/T3.png" alt="" /></p>
129 129
130<p>We&#39;re getting there!</p> 130<p>We&#39;re getting there!</p>
131 131
@@ -138,21 +138,21 @@ it does form an uneven surface. Add in some shadows to
138promote the idea of rice grains. Here is the finished 138promote the idea of rice grains. Here is the finished
139result:</p> 139result:</p>
140 140
141<p><img src="https://u.peppe.rs/VE.png" alt="highlights" /></p> 141<p><img src="https://u.peppe.rs/VE.png" alt="" /></p>
142 142
143<h3 id="Finishing%20Touches">Finishing Touches</h3> 143<h3 id="Finishing%20Touches">Finishing Touches</h3>
144 144
145<p>Some color correction and <code>a e s t h e t i c</code> Japanese text 145<p>Some color correction and <code>a e s t h e t i c</code> Japanese text
146later, our piece is complete!</p> 146later, our piece is complete!</p>
147 147
148<p><img src="https://u.peppe.rs/cn.png" alt="small_onigiri" /></p> 148<p><img src="https://u.peppe.rs/cn.png" alt="" /></p>
149 149
150<p>Hold on, why is it so tiny? Well, that&#39;s because our canvas 150<p>Hold on, why is it so tiny? Well, that&#39;s because our canvas
151was 100x100, head over to <code>Image &#62; Scale Image</code>, set 151was 100x100, head over to <code>Image &#62; Scale Image</code>, set
152<code>Quality &#62; Interpolation</code> to <code>None</code> and scale it up to 152<code>Quality &#62; Interpolation</code> to <code>None</code> and scale it up to
153700x700, et voilà!</p> 153700x700, et voilà!</p>
154 154
155<p><img src="https://u.peppe.rs/CH.png" alt="big_onigiri" /></p></description> 155<p><img src="https://u.peppe.rs/CH.png" alt="" /></p></description>
156<link>https://peppe.rs/posts/pixel_art_in_GIMP/</link> 156<link>https://peppe.rs/posts/pixel_art_in_GIMP/</link>
157<pubDate>Thu, 09 Apr 2020 16:28:00 +0000</pubDate> 157<pubDate>Thu, 09 Apr 2020 16:28:00 +0000</pubDate>
158<guid>https://peppe.rs/posts/pixel_art_in_GIMP/</guid> 158<guid>https://peppe.rs/posts/pixel_art_in_GIMP/</guid>
@@ -169,12 +169,12 @@ vim :)</p>
169<p>Here&#39;s a small sample of what had to be done (note the lines 169<p>Here&#39;s a small sample of what had to be done (note the lines
170prefixed with the arrow):</p> 170prefixed with the arrow):</p>
171 171
172<pre><code>→ use serde_json::{from_str}; 172<pre><code class="language-rust">→ use serde_json::{from_str};
173 173
174 #[test] 174 #[test]
175 fn deserialize() { 175 fn deserialize() {
176 assert_eq!( 176 assert_eq!(
177→ from_str::&#60;Action&#62;(r#&#34;{&#34;set_tweak&#34;: &#34;highlight&#34;}&#34;#), 177→ from_str::&#60;Action&#62;(r#"{"set_tweak": "highlight"}"#),
178 Action::SetTweak(Tweak::Highlight { value: true }) 178 Action::SetTweak(Tweak::Highlight { value: true })
179 ); 179 );
180 } 180 }
@@ -182,12 +182,12 @@ prefixed with the arrow):</p>
182 182
183<p>had to be converted to:</p> 183<p>had to be converted to:</p>
184 184
185<pre><code>→ use serde_json::{from_value}; 185<pre><code class="language-rust">→ use serde_json::{from_value};
186 186
187 #[test] 187 #[test]
188 fn deserialize() { 188 fn deserialize() {
189 assert_eq!( 189 assert_eq!(
190→ from_value::&#60;Action&#62;(json!({&#34;set_tweak&#34;: &#34;highlight&#34;})), 190→ from_value::&#60;Action&#62;(json!({"set_tweak": "highlight"})),
191 Action::SetTweak(Tweak::Highlight { value: true }) 191 Action::SetTweak(Tweak::Highlight { value: true })
192 ); 192 );
193 } 193 }
@@ -201,7 +201,7 @@ containing tests. Luckily, modules (and therefore files)
201containing tests in Rust are annotated with the 201containing tests in Rust are annotated with the
202<code>#[cfg(test)]</code> attribute. I opened all such files:</p> 202<code>#[cfg(test)]</code> attribute. I opened all such files:</p>
203 203
204<pre><code># `grep -l pattern files` lists all the files 204<pre><code class="language-bash"># `grep -l pattern files` lists all the files
205# matching the pattern 205# matching the pattern
206 206
207vim $(grep -l &#39;cfg\(test\)&#39; .&#47;**&#47;*.rs) 207vim $(grep -l &#39;cfg\(test\)&#39; .&#47;**&#47;*.rs)
@@ -227,23 +227,23 @@ every file in the arglist:</p>
227 227
228<h3 id="The%20quickfix%20list">The quickfix list</h3> 228<h3 id="The%20quickfix%20list">The quickfix list</h3>
229 229
230<p>Next up, replacing <code>r#&#34; ... &#34;#</code> with <code>json!( ... )</code>. I 230<p>Next up, replacing <code>r#" ... "#</code> with <code>json!( ... )</code>. I
231couldn&#39;t search and replace that trivially, so I went with a 231couldn&#39;t search and replace that trivially, so I went with a
232macro call <sup id="fnref2"><a href="#fn2" rel="footnote">2</a></sup> instead, starting with the cursor on 232macro call <sup id="fnref2"><a href="#fn2" rel="footnote">2</a></sup> instead, starting with the cursor on
233&#8216;r&#8217;, represented by the caret, in my attempt to breakdown 233&#8216;r&#8217;, represented by the caret, in my attempt to breakdown
234the process:</p> 234the process:</p>
235 235
236<pre><code>BUFFER: r#&#34; ... &#34;#; 236<pre><code>BUFFER: r#" ... "#;
237 ^ 237 ^
238 238
239ACTION: vllsjson!( 239ACTION: vllsjson!(
240 240
241BUFFER json!( ... &#34;#; 241BUFFER json!( ... "#;
242 ^ 242 ^
243 243
244ACTION: &#60;esc&#62;$F# 244ACTION: &#60;esc&#62;$F#
245 245
246BUFFER: json!( ... &#34;#; 246BUFFER: json!( ... "#;
247 ^ 247 ^
248 248
249ACTION: vhs)&#60;esc&#62; 249ACTION: vhs)&#60;esc&#62;
@@ -278,7 +278,7 @@ of positions is to use <code>vimgrep</code>:</p>
278with <code>:cnext</code> and <code>:cprev</code>. Every time you move up or down 278with <code>:cnext</code> and <code>:cprev</code>. Every time you move up or down
279the list, vim indicates your index:</p> 279the list, vim indicates your index:</p>
280 280
281<pre><code>(1 of 131): r#&#34;{&#34;set_tweak&#34;: &#34;highlight&#34;}&#34;#; 281<pre><code>(1 of 131): r#"{"set_tweak": "highlight"}"#;
282</code></pre> 282</code></pre>
283 283
284<p>And just like <code>argdo</code>, you can <code>cdo</code> to apply commands to 284<p>And just like <code>argdo</code>, you can <code>cdo</code> to apply commands to
@@ -380,7 +380,7 @@ side say, <code>s</code> cm. The total area covered by my 21&#8221; display
380is about 1,066 cm<sup>2</sup> (41x26). Thus,</p> 380is about 1,066 cm<sup>2</sup> (41x26). Thus,</p>
381 381
382<pre><code>Display A 382<pre><code>Display A
383Dimensions: 1366x768 @ 21&#34; (41x26 sq. cm) 383Dimensions: 1366x768 @ 21" (41x26 sq. cm)
3841,049,088 s^2 = 1066 3841,049,088 s^2 = 1066
385 s = 0.0318 cm (side of a pixel on Display A) 385 s = 0.0318 cm (side of a pixel on Display A)
386</code></pre> 386</code></pre>
@@ -389,7 +389,7 @@ Dimensions: 1366x768 @ 21&#34; (41x26 sq. cm)
389<code>B</code>:</p> 389<code>B</code>:</p>
390 390
391<pre><code>Display B 391<pre><code>Display B
392Dimensions: 1920x1080 @ 13&#34; (29.5x16.5 sq. cm) 392Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm)
3932,073,600 s^2 = 486.75 3932,073,600 s^2 = 486.75
394 s = 0.0153 cm (side of a pixel on Display B) 394 s = 0.0153 cm (side of a pixel on Display B)
395</code></pre> 395</code></pre>
@@ -510,7 +510,7 @@ mtZabXG.jpg p8d5c584f2841.jpg vjUxGjq.jpg
510did use it a couple times when my default music player was 510did use it a couple times when my default music player was
511acting up. <code>cmus</code> is a viable option:</p> 511acting up. <code>cmus</code> is a viable option:</p>
512 512
513<p><a href="https://u.peppe.rs/CP.jpg"><img src="https://u.peppe.rs/CP.jpg" alt="cmus.png" /></a></p></description> 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> 514<link>https://peppe.rs/posts/termux_tandem/</link>
515<pubDate>Sun, 08 Mar 2020 16:47:00 +0000</pubDate> 515<pubDate>Sun, 08 Mar 2020 16:47:00 +0000</pubDate>
516<guid>https://peppe.rs/posts/termux_tandem/</guid> 516<guid>https://peppe.rs/posts/termux_tandem/</guid>
@@ -593,7 +593,7 @@ I agree)</li>
593 593
594<p>And it&#39;s pretty! See for yourself:</p> 594<p>And it&#39;s pretty! See for yourself:</p>
595 595
596<p><a href="https://u.peppe.rs/wq.png"><img src="https://u.peppe.rs/wq.png" alt="gef.png" /></a></p> 596<p><a href="https://u.peppe.rs/wq.png"><img src="https://u.peppe.rs/wq.png" alt="" /></a></p>
597 597
598<h3 id="Editing">Editing</h3> 598<h3 id="Editing">Editing</h3>
599 599
@@ -628,7 +628,7 @@ can&#39;t find one.</p>
628(none, ample and over-the-top highlighting, from left to 628(none, ample and over-the-top highlighting, from left to
629right):</p> 629right):</p>
630 630
631<p><a href="https://u.peppe.rs/lt.png"><img src="https://u.peppe.rs/lt.png" alt="hi.png" /></a></p> 631<p><a href="https://u.peppe.rs/lt.png"><img src="https://u.peppe.rs/lt.png" alt="" /></a></p>
632 632
633<p>Without highlighting (far left), it is hard to differentiate 633<p>Without highlighting (far left), it is hard to differentiate
634between comments and code! The florid color scheme (far 634between comments and code! The florid color scheme (far
@@ -666,13 +666,13 @@ to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p>
666go into <code>posts&#47;</code>, get converted into html, and end up in 666go into <code>posts&#47;</code>, get converted into html, and end up in
667<code>docs&#47;index.html</code>, something like this:</p> 667<code>docs&#47;index.html</code>, something like this:</p>
668 668
669<pre><code>posts=$(ls -t .&#47;posts) # chronological order! 669<pre><code class="language-bash">posts=$(ls -t .&#47;posts) # chronological order!
670for f in $posts; do 670for f in $posts; do
671 file=&#34;.&#47;posts&#47;&#34;$f # `ls` mangled our file paths 671 file=".&#47;posts&#47;"$f # `ls` mangled our file paths
672 echo &#34;generating post $file&#34; 672 echo "generating post $file"
673 673
674 html=$(lowdown &#34;$file&#34;) 674 html=$(lowdown "$file")
675 echo -e &#34;html&#34; &#62;&#62; docs&#47;index.html 675 echo -e "html" &#62;&#62; docs&#47;index.html
676done 676done
677</code></pre> 677</code></pre>
678 678
@@ -682,16 +682,16 @@ done
682assets into the site source itself. That does have it&#8217;s 682assets into the site source itself. That does have it&#8217;s
683merits, but I prefer hosting images separately:</p> 683merits, but I prefer hosting images separately:</p>
684 684
685<pre><code># strip file extension 685<pre><code class="language-bash"># strip file extension
686ext=&#34;${1##*.}&#34; 686ext="${1##*.}"
687 687
688# generate a random file name 688# generate a random file name
689id=$( cat &#47;dev&#47;urandom | tr -dc &#39;a-zA-Z0-9&#39; | fold -w 2 | head -n 1 ) 689id=$( cat &#47;dev&#47;urandom | tr -dc &#39;a-zA-Z0-9&#39; | fold -w 2 | head -n 1 )
690id=&#34;$id.$ext&#34; 690id="$id.$ext"
691 691
692# copy to my file host 692# copy to my file host
693scp -P 443 &#34;$1&#34; emerald:files&#47;&#34;$id&#34; 693scp -P 443 "$1" emerald:files&#47;"$id"
694echo &#34;https:&#47;&#47;u.peppe.rs&#47;$id&#34; 694echo "https:&#47;&#47;u.peppe.rs&#47;$id"
695</code></pre> 695</code></pre>
696 696
697<h3 id="Templating">Templating</h3> 697<h3 id="Templating">Templating</h3>
@@ -711,7 +711,7 @@ listing!</p></description>
711<description><p>Decided to do one of these because everyone does one of 711<description><p>Decided to do one of these because everyone does one of
712these.</p> 712these.</p>
713 713
714<p><img src="https://u.peppe.rs/Hb.png" alt="scrot" /></p> 714<p><img src="https://u.peppe.rs/Hb.png" alt="" /></p>
715 715
716<p>My entire setup is managed with GNU <code>stow</code>, making it easier 716<p>My entire setup is managed with GNU <code>stow</code>, making it easier
717to replicate on fresh installations. You can find my 717to replicate on fresh installations. You can find my
@@ -774,8 +774,8 @@ PING ...
774 774
775<pre><code>------------------------------------------------------ 775<pre><code>------------------------------------------------------
776# Add these to &#47;etc&#47;wpa_supplicant&#47;wpa_supplicant.conf 776# Add these to &#47;etc&#47;wpa_supplicant&#47;wpa_supplicant.conf
777OPTS=&#34;-B&#34; 777OPTS="-B"
778WPA_INTERFACE=&#34;wlp2s0&#34; 778WPA_INTERFACE="wlp2s0"
779------------------------------------------------------ 779------------------------------------------------------
780$ sudo ln -s &#47;etc&#47;sv&#47;wpa_supplicant &#47;var&#47;service&#47; 780$ sudo ln -s &#47;etc&#47;sv&#47;wpa_supplicant &#47;var&#47;service&#47;
781$ sudo ln -s &#47;etc&#47;sv&#47;dhcpcd &#47;var&#47;service&#47; 781$ sudo ln -s &#47;etc&#47;sv&#47;dhcpcd &#47;var&#47;service&#47;
@@ -877,7 +877,7 @@ and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.
877a sample from the script used to generate this site: </p> 877a sample from the script used to generate this site: </p>
878 878
879<pre><code># a substitution to convert snake_case to Title Case With Spaces 879<pre><code># a substitution to convert snake_case to Title Case With Spaces
880echo &#34;$1&#34; | sed -E -e &#34;s&#47;\..+$&#47;&#47;g&#34; -e &#34;s&#47;_(.)&#47; \u\1&#47;g&#34; -e &#34;s&#47;^(.)&#47;\u\1&#47;g&#34; 880echo "$1" | sed -E -e "s&#47;\..+$&#47;&#47;g" -e "s&#47;_(.)&#47; \u\1&#47;g" -e "s&#47;^(.)&#47;\u\1&#47;g"
881</code></pre> 881</code></pre>
882 882
883<p>Instead of dropping into a new shell, just test it out directly from vim!</p> 883<p>Instead of dropping into a new shell, just test it out directly from vim!</p>
@@ -896,7 +896,7 @@ echo &#34;$1&#34; | sed -E -e &#34;s&#47;\..+$&#47;&#47;g&#34; -e &#34;s&#47;_(
896<pre><code>syntax off # previously run commands 896<pre><code>syntax off # previously run commands
897edit index.html # in a buffer! 897edit index.html # in a buffer!
898w | so % 898w | so %
899!echo &#34;new_post.md&#34; | sed -E -e &#34;s&#47;\..+$&#47;&#47;g&#34; --snip-- 899!echo "new_post.md" | sed -E -e "s&#47;\..+$&#47;&#47;g" --snip--
900^--- note the use of &#39;!&#39; 900^--- note the use of &#39;!&#39;
901</code></pre></li> 901</code></pre></li>
902<li><p>Hit enter with the cursor on the line containing your command!</p> 902<li><p>Hit enter with the cursor on the line containing your command!</p>
@@ -926,8 +926,8 @@ none of which concern us.</p>
926our view, and restore it once its done, with <code>winrestview</code>.</p> 926our view, and restore it once its done, with <code>winrestview</code>.</p>
927 927
928<pre><code>let view = winsaveview() 928<pre><code>let view = winsaveview()
929s&#47;\s\+$&#47;&#47;gc &#34; find and (confirm) replace trailing blanks 929s&#47;\s\+$&#47;&#47;gc " find and (confirm) replace trailing blanks
930winrestview(view) &#34; restore our original view! 930winrestview(view) " restore our original view!
931</code></pre> 931</code></pre>
932 932
933<p>It might seem a little overkill in the above example, just use `` (double 933<p>It might seem a little overkill in the above example, just use `` (double
@@ -942,23 +942,23 @@ heavier filtering.</p></description>
942<description><ol start="1"> 942<description><ol start="1">
943<li><p>reselecting previously selected text (i use this to fix botched selections):</p> 943<li><p>reselecting previously selected text (i use this to fix botched selections):</p>
944 944
945<pre><code>gv &#34; :h gv for more 945<pre><code>gv " :h gv for more
946 &#34; 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
947 &#34; use a motion to fix the selection 947 " use a motion to fix the selection
948</code></pre></li> 948</code></pre></li>
949<li><p>reselecting previously yanked text:</p> 949<li><p>reselecting previously yanked text:</p>
950 950
951<pre><code>`[v`] 951<pre><code>`[v`]
952`[ &#34; marks the beginning of the previously yanked text :h `[ 952`[ " marks the beginning of the previously yanked text :h `[
953`] &#34; marks the end :h `] 953`] " marks the end :h `]
954 v &#34; visual select everything in between 954 v " visual select everything in between
955 955
956nnoremap gb `[v`] &#34; &#34;a quick map to perform the above 956nnoremap gb `[v`] " "a quick map to perform the above
957</code></pre></li> 957</code></pre></li>
958<li><p>pasting and indenting text (in one go):</p> 958<li><p>pasting and indenting text (in one go):</p>
959 959
960<pre><code>]p &#34; put (p) and adjust indent to current line 960<pre><code>]p " put (p) and adjust indent to current line
961]P &#34; put the text before the cursor (P) and adjust indent to current line 961]P " put the text before the cursor (P) and adjust indent to current line
962</code></pre></li> 962</code></pre></li>
963</ol></description> 963</ol></description>
964<link>https://peppe.rs/posts/get_better_at_yanking_and_putting_in_vim/</link> 964<link>https://peppe.rs/posts/get_better_at_yanking_and_putting_in_vim/</link>