Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
c407e8be9e
|
|||
f52b241dc2
|
|||
c0755da29f
|
|||
c3afb4b562
|
|||
f5b3d969fd
|
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "git-lfs"
|
||||
tags: [ "data", "git" ]
|
||||
requires: [ "git" ]
|
||||
---
|
||||
|
||||
Git Large File Storage ('LFS') needs to change your `~/.gitconfig` to check out those binary files:
|
||||
|
69
data/git/git_stash.md
Normal file
69
data/git/git_stash.md
Normal file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
title: "git stash"
|
||||
tags: [ "data", "git" ]
|
||||
requires: [ "git" ]
|
||||
---
|
||||
|
||||
Save file-changes without committing anything.
|
||||
|
||||
Change a file:
|
||||
|
||||
```sh
|
||||
file=README.md
|
||||
fortune >> ${file}
|
||||
git diff
|
||||
git stash save
|
||||
```
|
||||
|
||||
List which stashes you have:
|
||||
|
||||
|
||||
```sh
|
||||
git stash list
|
||||
|
||||
stash@{1}: WIP on master: c21f102 init git
|
||||
```
|
||||
|
||||
Make a new file, then stash it:
|
||||
|
||||
|
||||
```sh
|
||||
otherfile=file.log
|
||||
fortune > ${otherfile}
|
||||
git add ${otherfile}
|
||||
stashname=logfile
|
||||
git stash save ${stashname}
|
||||
```
|
||||
|
||||
Now you can see two stashed changes, and the most recent has a name:
|
||||
|
||||
```sh
|
||||
git stash list
|
||||
|
||||
stash@{0}: On master: logfile
|
||||
stash@{1}: WIP on master: c21f102 init git
|
||||
```
|
||||
|
||||
You can delete a stash by referring to its index number, or name (if it has one).
|
||||
|
||||
```sh
|
||||
choice=1
|
||||
git stash drop ${choice}
|
||||
|
||||
choice=${stashname}
|
||||
git stash drop ${choice}
|
||||
```
|
||||
|
||||
Or just run `git stash drop` to remove the most recent (labelled `{0}`).
|
||||
|
||||
Return stashed changes with an index number (or the most recent).
|
||||
|
||||
```sh
|
||||
git stash pop ${choice}
|
||||
```
|
||||
|
||||
Delete all stashes:
|
||||
|
||||
```sh
|
||||
git stash clear
|
||||
```
|
@@ -10,7 +10,7 @@ ffmpeg -i [input file] output_file.mkv
|
||||
|
||||
The input file might be a device, such as a camera.
|
||||
|
||||
#Record screen
|
||||
# Record screen
|
||||
|
||||
Take the format as 'grab the x11 screen'.
|
||||
|
||||
@@ -30,7 +30,8 @@ or maybe just...
|
||||
ffmpeg -f x11grab -s "$(xdpyinfo | grep dimensions | awk '{print $2}')" -i :1.0 out.mkv
|
||||
```
|
||||
|
||||
#Add default pulse audio
|
||||
# Add default pulse audio
|
||||
|
||||
```bash
|
||||
ffmpeg -f x11grab -s [screensize] -i :0.0 -f alsa -i default out.mkv
|
||||
```
|
||||
|
22
vision/make_a_gif.md
Normal file
22
vision/make_a_gif.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "Make a gif"
|
||||
tags: [ "vision" ]
|
||||
---
|
||||
|
||||
Split your video into frames.
|
||||
|
||||
```sh
|
||||
d=$(mktemp -d)
|
||||
cp $vid.mp4 $d
|
||||
cd $d
|
||||
|
||||
ffmpeg -i $vid.mp4 -vf "fps=10, scale=360:-1" frame%04d.png
|
||||
gifski --fps 10 -o ${out}.gif frame*.png
|
||||
```
|
||||
|
||||
Optimize:
|
||||
|
||||
```sh
|
||||
gifsicle --optimize=3 --lossy=100 -o ${final}.gif ${out}.gif
|
||||
```
|
||||
|
@@ -3,13 +3,14 @@ title: "vim basics"
|
||||
tags: [ "vim", "basic" ]
|
||||
---
|
||||
|
||||
1. Insert text by pressing `i`.
|
||||
1. Insert text by pressing `a`.
|
||||
1. Stop inserting text by pressing `Ctrl+[`.
|
||||
1. Exit with `ZZ`.
|
||||
1. Congratulations, you now know `vim`.
|
||||
|
||||
## Extras
|
||||
|
||||
- [Learning Vim](vim/vi.md)
|
||||
- [Navigation](vim/navigate.md)
|
||||
- [Completion](vim/completion.md)
|
||||
- [Search](vim/search.md)
|
||||
|
46
writing/vim/vi.md
Normal file
46
writing/vim/vi.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "How to Learn `vim`"
|
||||
tags: [ "vim", "learning" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
|
||||
1. Uninstall `vim`.
|
||||
1. Install `vi`.
|
||||
1. Write a few blog posts.
|
||||
|
||||
The [ancient wisdom](https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118) is correct - everyone should start with `vi`.
|
||||
But the standard wisdom fails to mention writing.
|
||||
So people just 'try to remember', then they edit a couple of configuration files with `vim`, then stop, because it's a pain to think about keystrokes while thinking about how the configuration file works.
|
||||
Nobody can learn like that.
|
||||
|
||||
Learn with a blog, or writing emails in `vim`, or writing anything, as long as it's *real writing*.
|
||||
Write a journal or some recipes.
|
||||
Write literally anything which is written in paragraphs.
|
||||
|
||||
And while you're writing, remember one rule: if you want something, `vi` can do it, you just need to look up how.
|
||||
|
||||
Blog first, then try out some of these commands:
|
||||
|
||||
- `hjkl`
|
||||
- `x`
|
||||
- `:!grep very %`
|
||||
- `onew line<Esc>...`
|
||||
- `Onew line<Esc>...`
|
||||
- `~`
|
||||
- `~~~~`
|
||||
- `$r!`
|
||||
- `w %-2`
|
||||
- `x!`
|
||||
- `0RTipex`
|
||||
- `_4rX`
|
||||
- `bc2e`
|
||||
- `c2E`
|
||||
- `cw`
|
||||
- `cW`
|
||||
- `ci'`
|
||||
- `zz`
|
||||
- `:set number`
|
||||
- `:set nonumber`
|
||||
- `:set relativenumber`
|
||||
- `:set number relativenumber`
|
||||
|
Reference in New Issue
Block a user