From 2fda85fccb23212747828d0f3f55ae16e5ff956b Mon Sep 17 00:00:00 2001
From: Akshay n
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:
I turn the size down all the way to 1 ([
on the keyboard).
Set Dynamics
off. Here’s a
@@ -79,14 +79,14 @@ merge it with the original.
Your outline might look something like this:
- +Go ahead and fill it in with the fill tool (Shift + b
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.
Shadows on any surface always follow the shape of the surface. A spherical onigiri would have a circular shadow:
- +A couple of noticeable changes:
@@ -112,7 +112,7 @@ edges). filling in that area with another, darker shadow! An image might explain better: - +To emulate soft lights, reduce the value by 2 to 3 points
every iteration. Notice how area 1
is much larger than
@@ -125,7 +125,7 @@ light than areas 3
and 4
.
We're getting there!
@@ -138,21 +138,21 @@ it does form an uneven surface. Add in some shadows to promote the idea of rice grains. Here is the finished result: - +Some color correction and a e s t h e t i c
Japanese text
later, our piece is complete!
Hold on, why is it so tiny? Well, that's because our canvas
was 100x100, head over to Image > Scale Image
, set
Quality > Interpolation
to None
and scale it up to
700x700, et voilà!
Here's a small sample of what had to be done (note the lines prefixed with the arrow):
-→ use serde_json::{from_str};
+→ use serde_json::{from_str};
#[test]
fn deserialize() {
assert_eq!(
-→ from_str::<Action>(r#"{"set_tweak": "highlight"}"#),
+→ from_str::<Action>(r#"{"set_tweak": "highlight"}"#),
Action::SetTweak(Tweak::Highlight { value: true })
);
}
@@ -182,12 +182,12 @@ prefixed with the arrow):
had to be converted to:
-→ use serde_json::{from_value};
+→ use serde_json::{from_value};
#[test]
fn deserialize() {
assert_eq!(
-→ from_value::<Action>(json!({"set_tweak": "highlight"})),
+→ from_value::<Action>(json!({"set_tweak": "highlight"})),
Action::SetTweak(Tweak::Highlight { value: true })
);
}
@@ -201,7 +201,7 @@ containing tests. Luckily, modules (and therefore files)
containing tests in Rust are annotated with the
#[cfg(test)]
attribute. I opened all such files:
-# `grep -l pattern files` lists all the files
+# `grep -l pattern files` lists all the files
# matching the pattern
vim $(grep -l 'cfg\(test\)' ./**/*.rs)
@@ -227,23 +227,23 @@ every file in the arglist:
The quickfix list
-Next up, replacing r#" ... "#
with json!( ... )
. I
+
Next up, replacing r#" ... "#
with json!( ... )
. I
couldn't search and replace that trivially, so I went with a
macro call 2 instead, starting with the cursor on
‘r’, represented by the caret, in my attempt to breakdown
the process:
-BUFFER: r#" ... "#;
+BUFFER: r#" ... "#;
^
ACTION: vllsjson!(
-BUFFER json!( ... "#;
+BUFFER json!( ... "#;
^
ACTION: <esc>$F#
-BUFFER: json!( ... "#;
+BUFFER: json!( ... "#;
^
ACTION: vhs)<esc>
@@ -278,7 +278,7 @@ of positions is to use vimgrep
:
with :cnext
and :cprev
. Every time you move up or down
the list, vim indicates your index:
-(1 of 131): r#"{"set_tweak": "highlight"}"#;
+(1 of 131): r#"{"set_tweak": "highlight"}"#;
And just like argdo
, you can cdo
to apply commands to
@@ -380,7 +380,7 @@ side say, s
cm. The total area covered by my 21” display
is about 1,066 cm2 (41x26). Thus,
Display A
-Dimensions: 1366x768 @ 21" (41x26 sq. cm)
+Dimensions: 1366x768 @ 21" (41x26 sq. cm)
1,049,088 s^2 = 1066
s = 0.0318 cm (side of a pixel on Display A)
@@ -389,7 +389,7 @@ Dimensions: 1366x768 @ 21" (41x26 sq. cm)
B
:
Display B
-Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm)
+Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm)
2,073,600 s^2 = 486.75
s = 0.0153 cm (side of a pixel on Display B)
@@ -510,7 +510,7 @@ mtZabXG.jpg p8d5c584f2841.jpg vjUxGjq.jpg
did use it a couple times when my default music player was
acting up. cmus
is a viable option:
-
+
https://peppe.rs/posts/termux_tandem/
Sun, 08 Mar 2020 16:47:00 +0000
https://peppe.rs/posts/termux_tandem/
@@ -593,7 +593,7 @@ I agree)
And it's pretty! See for yourself:
-
+
Editing
@@ -628,7 +628,7 @@ can't find one.
(none, ample and over-the-top highlighting, from left to
right):
-
+
Without highlighting (far left), it is hard to differentiate
between comments and code! The florid color scheme (far
@@ -666,13 +666,13 @@ to html with lowdown.
go into posts/
, get converted into html, and end up in
docs/index.html
, something like this:
-posts=$(ls -t ./posts) # chronological order!
+posts=$(ls -t ./posts) # chronological order!
for f in $posts; do
- file="./posts/"$f # `ls` mangled our file paths
- echo "generating post $file"
+ file="./posts/"$f # `ls` mangled our file paths
+ echo "generating post $file"
- html=$(lowdown "$file")
- echo -e "html" >> docs/index.html
+ html=$(lowdown "$file")
+ echo -e "html" >> docs/index.html
done
@@ -682,16 +682,16 @@ done
assets into the site source itself. That does have it’s
merits, but I prefer hosting images separately:
-# strip file extension
-ext="${1##*.}"
+# strip file extension
+ext="${1##*.}"
# generate a random file name
id=$( cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1 )
-id="$id.$ext"
+id="$id.$ext"
# copy to my file host
-scp -P 443 "$1" emerald:files/"$id"
-echo "https://u.peppe.rs/$id"
+scp -P 443 "$1" emerald:files/"$id"
+echo "https://u.peppe.rs/$id"
Templating
@@ -711,7 +711,7 @@ listing!
Decided to do one of these because everyone does one of
these.
-
+
My entire setup is managed with GNU stow
, making it easier
to replicate on fresh installations. You can find my
@@ -774,8 +774,8 @@ PING ...
------------------------------------------------------
# Add these to /etc/wpa_supplicant/wpa_supplicant.conf
-OPTS="-B"
-WPA_INTERFACE="wlp2s0"
+OPTS="-B"
+WPA_INTERFACE="wlp2s0"
------------------------------------------------------
$ sudo ln -s /etc/sv/wpa_supplicant /var/service/
$ sudo ln -s /etc/sv/dhcpcd /var/service/
@@ -877,7 +877,7 @@ and the ability to jump around with Ctrl-]
and Ctrl-T
.
a sample from the script used to generate this site:
# a substitution to convert snake_case to Title Case With Spaces
-echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g"
+echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g"
Instead of dropping into a new shell, just test it out directly from vim!
@@ -896,7 +896,7 @@ echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(
syntax off # previously run commands
edit index.html # in a buffer!
w | so %
-!echo "new_post.md" | sed -E -e "s/\..+$//g" --snip--
+!echo "new_post.md" | sed -E -e "s/\..+$//g" --snip--
^--- note the use of '!'
Hit enter with the cursor on the line containing your command!
@@ -926,8 +926,8 @@ none of which concern us.
our view, and restore it once its done, with winrestview
.
let view = winsaveview()
-s/\s\+$//gc " find and (confirm) replace trailing blanks
-winrestview(view) " restore our original view!
+s/\s\+$//gc " find and (confirm) replace trailing blanks
+winrestview(view) " restore our original view!
It might seem a little overkill in the above example, just use `` (double
@@ -942,23 +942,23 @@ heavier filtering.
reselecting previously selected text (i use this to fix botched selections):
-gv " :h gv for more
- " you can use `o` in visual mode to go to the `Other` end of the selection
- " use a motion to fix the selection
+gv " :h gv for more
+ " you can use `o` in visual mode to go to the `Other` end of the selection
+ " use a motion to fix the selection
reselecting previously yanked text:
`[v`]
-`[ " marks the beginning of the previously yanked text :h `[
-`] " marks the end :h `]
- v " visual select everything in between
+`[ " marks the beginning of the previously yanked text :h `[
+`] " marks the end :h `]
+ v " visual select everything in between
-nnoremap gb `[v`] " "a quick map to perform the above
+nnoremap gb `[v`] " "a quick map to perform the above
pasting and indenting text (in one go):
-]p " put (p) and adjust indent to current line
-]P " put the text before the cursor (P) and adjust indent to current line
+]p " put (p) and adjust indent to current line
+]P " put the text before the cursor (P) and adjust indent to current line
https://peppe.rs/posts/get_better_at_yanking_and_putting_in_vim/
diff --git a/posts/call_to_ARMs.md b/posts/call_to_ARMs.md
index 0d0a741..ccf5058 100644
--- a/posts/call_to_ARMs.md
+++ b/posts/call_to_ARMs.md
@@ -76,7 +76,7 @@ experience loads better:
And it's pretty! See for yourself:
-[![gef.png](https://u.peppe.rs/wq.png)](https://u.peppe.rs/wq.png)
+[![](https://u.peppe.rs/wq.png)](https://u.peppe.rs/wq.png)
### Editing
diff --git a/posts/color_conundrum.md b/posts/color_conundrum.md
index 80a13cd..f17760a 100644
--- a/posts/color_conundrum.md
+++ b/posts/color_conundrum.md
@@ -21,7 +21,7 @@ The following comparison does a better job of explaining
(none, ample and over-the-top highlighting, from left to
right):
-[![hi.png](https://u.peppe.rs/lt.png)](https://u.peppe.rs/lt.png)
+[![](https://u.peppe.rs/lt.png)](https://u.peppe.rs/lt.png)
Without highlighting (far left), it is hard to differentiate
between comments and code! The florid color scheme (far
diff --git a/posts/my_setup.md b/posts/my_setup.md
index c3868eb..0b43a49 100644
--- a/posts/my_setup.md
+++ b/posts/my_setup.md
@@ -1,7 +1,7 @@
Decided to do one of these because everyone does one of
these.
-![scrot](https://u.peppe.rs/Hb.png)
+![](https://u.peppe.rs/Hb.png)
My entire setup is managed with GNU `stow`, making it easier
to replicate on fresh installations. You can find my
diff --git a/posts/pixel_art_in_GIMP.md b/posts/pixel_art_in_GIMP.md
index be925ca..4e0b087 100644
--- a/posts/pixel_art_in_GIMP.md
+++ b/posts/pixel_art_in_GIMP.md
@@ -30,7 +30,7 @@ Pencil Tool (`n` 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:
-![hard edge vs soft edge](https://u.peppe.rs/kz.png)
+![Hard edge vs Soft Edge](https://u.peppe.rs/kz.png)
I turn the size down all the way to 1 (`[` on the keyboard).
Set `Dynamics` off. [Here's](https://u.peppe.rs/Fs.png) a
@@ -62,14 +62,14 @@ merge it with the original.
Your outline might look something like this:
-![rice_outline](https://u.peppe.rs/mn.png)
+![](https://u.peppe.rs/mn.png)
Go ahead and fill it in with the fill tool (`Shift + b` 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.
-![with_seaweed](https://u.peppe.rs/xu.png)
+![](https://u.peppe.rs/xu.png)
#### Shadows
@@ -80,7 +80,7 @@ surface later.
Shadows on any surface always follow the shape of the
surface. A spherical onigiri would have a circular shadow:
-![riceball_shadow](https://u.peppe.rs/FU.png)
+![](https://u.peppe.rs/FU.png)
A couple of noticeable changes:
@@ -95,7 +95,7 @@ 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:
-![shadow_all](https://u.peppe.rs/Br.png)
+![](https://u.peppe.rs/Br.png)
To emulate soft lights, reduce the value by 2 to 3 points
every iteration. Notice how area `1` is much larger than
@@ -108,7 +108,7 @@ 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:
-![shadow_weed](https://u.peppe.rs/T3.png)
+![](https://u.peppe.rs/T3.png)
We're getting there!
@@ -121,19 +121,19 @@ it does form an uneven surface. Add in some shadows to
promote the idea of rice grains. Here is the finished
result:
-![highlights](https://u.peppe.rs/VE.png)
+![](https://u.peppe.rs/VE.png)
### Finishing Touches
Some color correction and `a e s t h e t i c` Japanese text
later, our piece is complete!
-![small_onigiri](https://u.peppe.rs/cn.png)
+![](https://u.peppe.rs/cn.png)
Hold on, why is it so tiny? Well, that's because our canvas
was 100x100, head over to `Image > Scale Image`, set
`Quality > Interpolation` to `None` and scale it up to
700x700, et voilà!
-![big_onigiri](https://u.peppe.rs/CH.png)
+![](https://u.peppe.rs/CH.png)
diff --git a/posts/rapid_refactoring_with_vim.md b/posts/rapid_refactoring_with_vim.md
index 4dd3186..e38cef3 100644
--- a/posts/rapid_refactoring_with_vim.md
+++ b/posts/rapid_refactoring_with_vim.md
@@ -8,7 +8,7 @@ vim :)
Here's a small sample of what had to be done (note the lines
prefixed with the arrow):
-```
+```rust
→ use serde_json::{from_str};
#[test]
@@ -22,7 +22,7 @@ prefixed with the arrow):
had to be converted to:
-```
+```rust
→ use serde_json::{from_value};
#[test]
@@ -42,7 +42,7 @@ containing tests. Luckily, modules (and therefore files)
containing tests in Rust are annotated with the
`#[cfg(test)]` attribute. I opened all such files:
-```
+```bash
# `grep -l pattern files` lists all the files
# matching the pattern
diff --git a/posts/static_sites_with_bash.md b/posts/static_sites_with_bash.md
index 62e43d8..1b6b2ec 100644
--- a/posts/static_sites_with_bash.md
+++ b/posts/static_sites_with_bash.md
@@ -15,7 +15,7 @@ I host my site on GitHub pages, so
go into `posts/`, get converted into html, and end up in
`docs/index.html`, something like this:
-```
+```bash
posts=$(ls -t ./posts) # chronological order!
for f in $posts; do
file="./posts/"$f # `ls` mangled our file paths
@@ -31,7 +31,7 @@ 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:
-```
+```bash
# strip file extension
ext="${1##*.}"
diff --git a/posts/termux_tandem.md b/posts/termux_tandem.md
index 7c61beb..8344d40 100644
--- a/posts/termux_tandem.md
+++ b/posts/termux_tandem.md
@@ -45,4 +45,4 @@ Alright, I don't really listen to music via `cmus`, but I
did use it a couple times when my default music player was
acting up. `cmus` is a viable option:
-[![cmus.png](https://u.peppe.rs/CP.jpg)](https://u.peppe.rs/CP.jpg)
+[![](https://u.peppe.rs/CP.jpg)](https://u.peppe.rs/CP.jpg)
--
cgit v1.2.3