118 liens privés
via sebsauvage
So useful
This is a tremendously useful website for vim users.
Lists plugins for vim.
Sometimes, I find the text so dense and difficult to read ( even when I think it is particularly well written ).
hello https://www.bortzmeyer.org/ --
Now I have this one bookmarklet installed.
By the way, that means bookmarklets work again !
Not much to say, is 2.6.x compliant
It took me some time to understand that sugar syntax.
First of : it's &
:to_s
obviously.
Operator is &
.
What does it do ?
it turns
mythings.map(& :upcase)
# is the same as
mythings.map(&:upcase)
into
mythings.map { |mything| mything.upcase }
Remark : sugar syntax can be a pain in the butt. I hope you do see it.
The map
method applies the "block" { |mything| mything.upcase }
on each and every elements of mythings
and returns an enumerable of class mythings.class
containing each result.
The operator is &
and the argument in my example is :upcase
. :upcase
is a Symbol
.
Symbols have a smart to_proc
method.
Another example :
require 'date'
[1,DateTime.now,3].map(&:to_s)
# => ["1", "2021-09-05T12:06:54+02:00", "3"]
So how does it work ?
-
&̀
when a parameter of a method is prepended with&
then ruby knows this parameter to be a Proc -
:upcase is a symbol.
So the &:myproc
is a smart shortcut implemented to turn the symbol :myproc
into a proc.
Let's try it :
def call_my_block ( my_parameter, &myblock)
myblock.call.myblock
end
The parameter &myblock
is known to be a block.
When I use method call_my_block
with the argument &:my_symbol
:
- The second parameter is known to be a block.
- The argument will be translated into
:my_symbol.to_proc
If the first argument is of classKlass
andKlass
actually has amy_symbol
method, then it will call it.
Example :
call_my_block DateTime.now , &:to_s
translates into :
:to_s.to_proc.call DateTime.now
note that :
a = :to_s.to_proc
#=> #<Proc:0x000055e77c191c98(&:to_s)>
a.call(13)
#=> "13"
a.class
#=> Proc
Hence :
call_my_block DateTime.now , &:to_s
# => "2021-09-05T12:06:00+02:00"
[1,DateTime.now,3].map { |val| call_my_block(val,&:to_s) }
#=> ["1", "2021-09-05T12:21:54+02:00", "3"]
[1,DateTime.now,3].map(&:to_s)
["1", "2021-09-05T12:23:22+02:00", "3"]
Note ::
- A function/methods has parameters.
- When called the function is given arguments
In other terms, an argument is the value of a parameter.
Because copying data from one dynamodb to another dynamodb in another region is a pain in the butt even if you have a pretty small database.
Had to find a quick win. This tool has done the trick.
Impressive monitoring tool.
Raise alerts with complete configuration file to get informed through mail / etc
When they say "about no configuration", it is true.
It's a "tool" you take and use.
Just amazingly simple and pure efficiency.
Bravo.
Note : it will not help you understand what happened two weeks ago. It's not here to help you who did what three years ago, or what has happened last month with this or that. It 's a tool to monitor a platform health.
image manipulation online tool
search engine for cc images.
ActiveRecord::Base.logger = nil
Because debugging is not necessarily about SQL FFS, and Ikeep forgetting how to remove the super verbose SQL output in rails console.
A must have seen about database indexing.
I just like this video so much.
What a great show and explain demonstration.
jq is a lightweight and flexible command-line JSON processor.
myjson.json :
[{"name":"JSON", "good":true}, {"name":"XML", "good":false}]
CLI :
echo myjson.json | jq .[1]
outputs :
{
"name": "XML",
"good": false
}
L'accessibilité numérique au service de l'inclusion des personnes handicapées. Propose de faire des audits / diagnostic / formation / conseil etc.
gem TVA
building fully self-contained Python zipapps as outlined in PEP 441 but with all their dependencies included!
Shiv’s primary goal is making distributing Python applications fast & easy.
How it works
Shiv includes two major components: a builder and a small bootstrap runtime.
Yet another online store framework in ruby
A must have : explains what the regexp is doing
A great tool to learn / design regexp.
Changes my everyday life.
Quick and great little JSON editor.
Works like a charm for my usage.
Mainly using it when not on my computer (ie when using a windows computer).
Unfortunately, not in everyone's bookmark... hence worth mentioning here.
Useful guide.
Marked for soon usage.
via sebsauvage.net
édifiant…
Et pendant ce temps, en France, on se dit que c’est une super bonne idée de faire des fichiers qui listent vos goûts, vos sports, vos hobbies, vos tendances politiques, vos potes, vos centres d’intérêt, vos tendances sexuelles, votre religion, etc. en sachant que le tout est très souvent fort mal renseigné.
Le problème, comme le dit très justement sebsauvage.net : ce n’est pas que vous ayez ou non quelque chose à cacher ou à vous reprocher, c’est que ça peut amener des tarés à vous cibler totalement arbitrairement. Ce sont les autres qui vous reprochent d'exister.