Some tips 💡, some explanations ➰, some scripts ❓
Posts basically 🎉…
Motion and calculus (~ 3 min)
If you studied physics, one of the first things you probably did was graph the “motion” of objects. That is the displacement, velocity, and acceleration at an instant t. Didn’t it remind you of a mathematical concept?
Length of a curve (~ 3 min)
After misunderstanding a question in physics, I thought I had to calculate the length of a curved trajectory (ie. the distance) instead of just the straight line (ie. the displacement). Turns out it was the easy option, but I now wanted to know how to get the length of a curve. I mean, it’d just be summing up an infinite number of straight lines, which is almost exactly what integration is…
Tmux Zoom (~ 1 min)When you have multiple panes open in tmux, just press prefix z to toggle zoom mode. When activated, only the current pane will be shown. 😉
Vim file type specific settings (~ 1 min)
If you want to run some vim script for a specific file type, don’t make an auto command, they get messy really quickly. Instead, you should use
Jump to function definition in vim (~ 5 min)
Challenge #1: Translate back (~ 1 min)
I’ve got a little challenge for you.
So vim got slow (~ 2 min)
You know that feeling? You press in a key, and you have to wait like 0.5 seconds to see it appear on screen. You try to run
vim --cleanand everything’s back to “normal”. How do you find quickly the cause of this horrible disaster 😄
The Last Terminal Title (~ 2 min)
I use tmux, and in the tabs title, it displays the terminal’s title, which is just done by this 2 lines in your
0.9 Repeater (~ 1 min)
Today I learned something a bit weird in mathematics, which I find quiet funny and interesting.
So binary numbers are useful? (~ 8 min)
Do you know what binary numbers are? They’re just a way of counting with just 2 numbers: 0 and 1. For example,
9is in binary
This is the format your computer uses to do everything, at a very low level. Either there is some current, or there isn’t. And then, it interprets these numbers, and becomes what it is.
So, what the heck could be the use of binary numbers to us, simple programmers who write some code with all these different symbols, letters, and numbers? 🤔
How to combine svgs (~ 2 min)
If you want your website to be fast, you should limit the number of http requests. A great way of doing that is combining your images. If you use SVGS for your icons and stuff like that, here’s how you can combine all your icon in one big file, and use them in your website!
Vim Line Completion (~ 1 min)
Do you know what kind of completion this is? Line completion. It looks for every lines that starts with the same text (it doesn’t take into consideration the indication), and completes it for you! Awesome right?
Bash's fc command (~ 2 min)
When editing long commands in your terminal (you know, the one that wraps 😉), sometimes you’d be better of using your actual editor (like vim or Sublime). And guess what? Bash let’s you do that! 🎉
Bash's find command (~ 6 min)
findcommand in bash is quite powerful, and knowing the basics might save you some scripting.
What does it do? It “finds” files. By default, it outputs their path relative to where you ran
find. But, in addition of providing you with advanced “filters” it actually allows you to run commands on each of those files.
Deploying a hugo site on GitHub pages (~ 2 min)
When you want to deploy a static website built with the fantastic Hugo on GitHub pages, you don’t have 100 of possibilities. A clean one, and an easy one 😄.
My Zen (~ 1 min)
So, today, dans un élan d’inspiration, I decided to write my own.
My new blog (~ 4 min)
My name’s Mathieu Paturel -
@math2001- and I love coding. I’m French (from Provence, if you know where that is), but my family and I moved 2 years ago to Australia so that we could learn to speak fluently English (without this disgusting accent 😄).
The confirm option (~ 1 min)
This is probably one of my favorite option in VIM. Just add this to your
Great resources for VIM users (~ 1 min)
If you’re a VIM user, have a look at these resources, they’re pretty good (you probably will know some, if not all of them)
Silent command-line mapping (~ 1 min)
If you want to set a mapping to run something that is echoed into the command line (something starting with
/for example) to not be displayed, you can use the special argument
Rerun last command with bang (~ 1 min)
Put this code in your vimrc to re run the previous command but with the bang (
!) by just typing
DynamicOpen function (~ 1 min)
I really open my
.vimrcoften. Too often to have to type
:tabe ~/.vimrcevery time. Here’s little function that will open a file in a new tab if there isn’t enough room for a new split, and, you guessed it, in a new vertical split if there is.
Current buffer only mapping (~ 1 min)
If you want to set a mapping only for the current buffer in VIM, it’s super simple: just use the
On windows, the cmd sucks. But if you have sh installed from git-for-windows for example, you can tell vim to run external commands
To get the ASCII value of the character under the cursor, just press ga (or run :ascii). It’ll print it in three format: in decimal, hexadecimal and octal. So, when your cursor is on an arrow and that you press ga: →, you’ll see at the bottom: <→> 8594, Hex: 2192, Octal: 20622 Mnemonic: Get ASCII value. from :help :ascii
'readonly' != 'modifiable' (~ 1 min)
Do you know the difference between the option
Vim help index (~ 1 min)
A very strong point of vim is its documentation. There’s just so much of it!! So, use it
Vim digraphs (~ 2 min)
Ever wanted to write fancy symbols in your code or your documentation, like the copyright symbol for example (©). Do you know how much time it took me to insert this symbol? Less than a second… Do you know how much time it would have took you? Well, depending on your internet connection, it might be about 10 seconds.
Variable scopes in vim (~ 1 min)
An interesting feature of vim script is variable scoping. Here’s a copy-paste from the documentation, just in case you never saw it before.
The string module in Python (~ 1 min)
If you want every letter in the alphabet in python, don’t write them all out manually..
Network throttling (~ 1 min)
Ever wanted to simulate a slow connection? Well, the chrome’s DevTools makes it very easy to do!
How to insert the date in Vim? (~ 1 min)
First off, I really don’t recommend you use the
strftime()function vim has, since, as it says in the help message (