jbranchaud / til Goto Github PK
View Code? Open in Web Editor NEW:memo: Today I Learned
License: MIT License
:memo: Today I Learned
License: MIT License
For Move The Latest Commit To A New Branch, you can do it even more simply:
git branch my-new-branch
git reset --hard HEAD~
because git branch
, unlike git checkout -b
, doesn't actually take you to the newly created branch.
Hi,
It's a small issue in:
til / vim / Wrap With Some Room
This will not work with a vanilla vim.
It requires this plugin:
https://github.com/tpope/vim-surround
You should mention it.
Thanks!
Work around: https://github.com/davidbau/seedrandom/blob/released/seedrandom.js
Thanks for sharing this repo, fun stuff!
For security reasons you probably shouldn't have a boilerplate to seed a random number generator with predictable/structured input like the current time (which can be guessed by an attacker). Use crypto/rand
to seed your RNG.
It's also possible to recover the state of most PRNGs using the output, so you should usually just use crypto/rand
directly for your random data until the RNG becomes your program's bottleneck.
The link in the README points to /turning-timing-on.md
which is 404. The correct path is /turn-timing-on.md
.
For List filenames without the diffs, I find that --stat
is better than --name-only
because it at least gives you a quick count of changes/deletions per file while still keeping the one-line-per-file format.
I appreciate your guidance on integrating the wisdom
Small changes make great things
into my life
The above is listed in the README.md, but the actual file is at vim/scrolling-relative-to-the-cursor.md.
Excellent tip by the way, I'll be using this all the time.
Hey there,
Straight from signing up, one will have to look in the trash for the confirmation email. I'm guessing your newsletter will wind up there as well.
I don't think ConverKit is doing anything wrong...they're just sending a message from your email from some wonky-random-generated webpage.
I'm sure if you set these settings up the problem would go away (or not, because it's still gmail!).
This is how ProtonMail shows it, and the sneaker tracker.
Believe it or not, this is better than Microsoft 365 in Office, which just auto-trashes it.
The newsletter on your website from tinyletter works just fine :)
Maybe you're not even using the one in the README.md and problem solved with a small edit
It's not correct to say that time.Sleep takes Nanoseconds. It takes a time.Duration as you can see from the signature. Go is strongly typed, so you can't pass an int in there at all.
The confusion is created by the way go handles untyped constants like integer-literals: They don't have a type and arbitrary precision and they get a type inferred at the place they are used. If you use it as an integer-type, like int
, uint32
, rune
โฆ or time.Duration
, then that's the inferred type. That's how time.Sleep(42)
can work - 42 is then inferred to be a time.Duration
. However, that's more an unlucky consequence of the design, than intention. If no type can be inferred - for example when assigning it to a new variable, like x := 42
- a default type (int
for integer literals) is used, which is why above link creates a compiler-error.
I acknowledge that the exact details are hard to get right for "outsiders" not familiar with the language, but I just thought I should report that that statement isn't correct, technically :) It's not that time.Sleep
takes nanoseconds, it just that a time.Duration
is stored as an integer type with nanosecond granularity, so that's how an integer literal in place of a Duration is interpreted.
I tried compiling all markdown files of every category in one file in every directory(category) locally with pandocs
I tried this in powershell
foreach ($d in $dir){
$folderName = $d.Name;
pandoc (get-item D:/til/til/$folderName/*.md) -o D:/til/til/$folderName/$folderName-compilation.md
}
this created a compilation file like ack-compilation.md in ack folder containing combined markdown file content,
Maybe someone can automate the process for this github repo as reading TILS together for any particular category is much better than clicking links for every TIL.
This is the result
Hey! The issue you are seeing there with [0] is not an issue at all. The behaviour is completley normal if you embrace JS coercion (implicit casting) in ==
operator.
the issue is that in the expression [0] == false
, false
is actually coerced to a Number by the built-in object Number
, and of course: Number(false)
is 0!
Then, [0]
is first coerced to the String "0"
and finally coerced to the Number 0
.
So, the last comparision is actually 0 === 0. Which is obviously true.
Hope the explanation shed some light on the subject!
In
https://github.com/jbranchaud/til/blob/master/postgres/count-records-by-type.md
I prefer select type, count(*) from table group by 1
as is if the elements counted are something like select substring(unnaccent(upper('firstname',1,2))) ....
there are less character to type at the end of the command :)
The guide "List All The Say Voices" is filed under Unix; however, say
is an OS X-only command, so it should probably be moved to the Mac folder.
Hi!
I love the idea and am adopting it myself. I've created a script which will auto-generate the README.md file using the information already in the directory structure and the titles of each of the TIL markdown files. I've got it working and producing output that is close: the diffs are:
As I said, I've got the generation script, but I'm still thinking about how to get it into the work-flow. The options I can think of tonight are:
Neither of these are making me happy this evening, so I'm asking you if you have any ideas, that is, if you're interested at all.
Either way, Thanks for the great idea! I really like what you did. I'll admit I created my own before I saw your instructions (or thought about) forking your starter repo.
Thanks again!
In sed/grab-the-first-line-of-a-file.md
missing -n
in the first example.
In css/dry-up-scss-with-mixins.md
misspelled "navgation"...
@jbranchaud The line below is referencing vim/turning-off-search-highlighting.md
Line 1342 in 711310b
but the file in that folder is missing an f and is called vim/turning-of-search-highlighting.md
Suggested fix is to rename vim/turning-of-search-highlighting.md
-> vim/turning-off-search-highlighting.md
Simpler solution:
Array(9).fill().map((_, y) => y+1)
Or (Array(10)+"").replace(/,/g,(_,y)=>y+1)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.