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/
--
cgit v1.2.3