172 karma · joined Apr 9, 2019 (7y ago) · 98 submissions
91.
TIFU by spending the last year on Reddit talking to myself after being muted(reddit.com ↗)
6 points · by localhostdotdev · 7y ago · discuss
comment 7y ago · link · parent
> On redesign, a slightly-edited version of CommonMark. On old reddit, it's still snudown.
(and mobile apps have their own markdown)
> New Reddit note: Indented code blocks are the only form of code block that works on Old Reddit. Use them for compatibility
https://www.reddit.com/wiki/markdown#wiki_code_blocks_and_in...
maybe in a few years there is going to be syntax highlighting, one can hope :) (slack doesn't have it either, but even discord has it...)
comment 7y ago · link · parent
also:
> When a fork syscall is made on WSL, lxss.sys does some of the initial work to prepare for copying the process. It then calls internal NT APIs to create the process with the correct semantics and create a thread in the process with an identical register context. Finally, it does some additional work to complete copying the process and resumes the new process so it can begin executing.
https://blogs.msdn.microsoft.com/wsl/2016/06/08/wsl-system-c...
comment 7y ago · link · parent
def f(&block)
block.class
end
f { } # => Proc
f(&-> { }) # => Proc
f(&lambda { }) # => Proc
f(&:something) # => Proc
lambda { }.class # => Proc (I think you get the idea)
method(:f).class # => Method
lambda { |i| i + 1 }.call(10) # => 11
you don't typically return in a block, there is implicit return. you would do "next" or "break" depending on what you want to achieve. as far as I know that's the main difference between procs and methods.(not that anybody would do what I do, most people just use blocks, some people use yield, few people use the &block argument, but that's exactly the same)
comment 7y ago · link · parent
edit: ruby gem: https://github.com/libgit2/rugged which has a native extension written in C to bind libgit2 functions to ruby methods.
comment 7y ago · link · parent
obviously the lib folder requires a lot of git-specific knowledge but I didn't see any use of features that don't have exact or very similar equivalent in more popular programming languages.
I think the most "complex" might be things like Struct.new(*Inputs::ATTRS) where it's creating a new anonymous class from a list of attributes which becomes the class instance attributes (nothing crazy :) )
comment 7y ago · link · parent
I'm trying it out and doesn't work very well on macOS (git add has issue with the lockfile, but all tests pass).
I might use it as it's a very easily customizable implementation of git.