1,787 karma · joined Oct 29, 2013 (13y ago) · 405 submissions
author: The Tao of tmux (https://leanpub.com/the-tao-of-tmux) available to read for free online at https://leanpub.com/the-tao-of-tmux/free
software libraries: cihai, unihan-etl, tmuxp, libtmux, vcspull, libvcs
tony (at) git-pull.com
https://www.git-pull.com
(If what I say isn't helpful to you, disregard it. Spread the good will and good tidings!)
comment 7y ago · link · parent
One thing about Hong Kong that's a lot to take in is how western-friendly the culture is. I think there was a western news channel playing while I was on the MTR last time.
I am guessing some may find the rallies annoying. They may view them as hooligans, but even the cynical still are happy with HK being HK.
To understand more about HK system of government, check out the basic law: https://www.basiclaw.gov.hk/en/facts/index.html, https://www.basiclaw.gov.hk/en/basiclawtext/index.html. This effectively serves as the constitution of HK.
And it's a weird thing: Because it's effectively a client state constitution. heh. They have their own judiciary, they have their own case law, but the people of HK cannot amend their constitution.
P.S. I haven't read the latest part of the extradition law they're trying to pass (anyone have it?)
comment 7y ago · link · parent
Absolutely love graphql as a technology. The pagination and ability to structure a query to pull a lot of data is nice.
As for some of the other comments - it's true you can't just write any query: but you can always add new fields, lists, connections (basically a pagination-friendly list), etc against arbitrary things on the backend. It's your backend, you control what data you serve.
The graphql-python stack is layered like an onion (graphene on top, graphql-core inside). You will probably be doing something like flask-graphql or graphene-django on top of that.
There is a huge negative for python <-> graphql for us, and it's the error system and promises. Perhaps this is what graphql servers in JS are like, but graphql-core hijacks python's error system by wrapping fields in promises.
So graphql-core is acting very very true to graphql's implementation in node: to the point it creating a mountain of breadcrumbs in sentry.
It also overrides the "next" built-in and tries to emulate express-style callbacks. Another thing ported from node into python that doesn't translate well imo.
Aside from that though: graphene has been really speedy, fast to work with. Documentation is getting nicer. The developers on the issue tracker are very nice. And as a general graphql thing: https://github.com/graphql/graphiql is really nice!
And one more graphql thing: It's typed. In a big API, being able to lay out stuff like that goes a long way. We're generating typescript types via schema.graphql output, and response types via relay. In a real big frontend project, it pays off a lot.
I recommend giving graphql a shot.
33.
2019 redefinition of the SI base units(en.wikipedia.org ↗)
85 points · by tony · 7y ago · 92 comments
comment 7y ago · link · parent
Remote: Yes
Willing to relocate: No, sorry! Only remote - happy to travel onsite!
Technologies: Python, TypeScript, React/Vue, OAuth, Stripe, APIs (graphql/rest)
Website: https://www.git-pull.com
Résumé/CV: https://cv.git-pull.com
Github: https://github.com/tony
Email: tony at git-pull dot com
10+ years in startups. Open source background. Looking for remote opportunities. Team player!
comment 7y ago · link · parent
https://aosabook.org/en/500L/web-spreadsheet.html
Chinese (Traditional): https://github.com/aosabook/500lines/blob/master/spreadsheet...
https://aosabook.org/en/socialcalc.html
You can check the series out in its entirety at https://aosabook.org
comment 7y ago · link · parent
Windows 10 snapping keyboard keys are top tier. Not automated tiling, but save so much time. Also the GUI is beautiful on whatever screen you plug it into (including 4k). On Linux DE's right now? Mint or gnome will show options to scale up 200%, 300%, 400%(!) Even 200% is far to much.
Tiling WM+HDPI doesn't quite exist. Most use gtkrc, xresources, and the WM config to play with sizes. But that doesn't translate across different monitors. So it's a flawed system.
Let's assume HDPI+linux and tiling WM's were ironed out: In practice tiling WM's aren't as good because once you get into a terminal window, it's not as easy as it looks to copy from terminals <-> "gui" applications. It's possible, but the time spent ironing it out may not be worth the trade off for some. For instance I can't rely on copying from a vim inside of tmux, I do :!leafpad % to open a file and copy from that.
As for HDPI and tiling WM's, swaywm is an i3 for wayland that appears to support it: https://swaywm.org/
If you're okay with just HDPI and basic snapping: https://system76.com/pop or gnome 3.32 (that'd be ubuntu 19.04 or debian experimental at the moment I believe). Gnome 3.32 has fractional scaling. That'll scale by 125%, 150%, 175% (probably what you want)
Gnome's snapping isn't a smooth as Window 10's. Windows 10 is really good and half-sizing vertically. IMO: It'd be ideal if gnome 3 behaved the same as windows snap did by default. Extensions can help, but if you rely on them, they're limited and often behind of the latest gnome version (or two or three, or become abandoned entirely [1]), and don't wire-in to keybindings as well.
comment 7y ago · link · parent
I haven't seen this puzzle game before, I had to read into it a bit (and had to actually cheat a bit, via solve_puzzles.py.)
Works fine out of the box with python 3, no extra libraries required.
This is good enough to submit to PyPI. Seems like a nice terminal game. Something to play in a tmux pane while tests are running or while waking up with a coffee.
Also I looked at the code, it looks fine.
I saw the multiprocessing in generate_puzzles. Wow. I don't even know what Thread.starmap does. This works nicely.
Keep it up!
38.
Faster CPython(faster-cpython.readthedocs.io ↗)
2 points · by git-pull · 7y ago · discuss
comment 7y ago · link · parent
Most of the stuff I said still sticks for me (after reading article, and after using ORM this time).
I haven't programmed much golang. But with Python + Django I can use `./manage.py shell_plus` and can drop immediately into a shell with history, readline support, syntax highlighting, and tab completion, with all model objects in local scope.
I can then do lookups and annotations (Yes, they're expensive, not for production, but save lots of time during the day in a pinch):
Lookup:
Library.objects.filter(books__author__name='Book author')
Annotation: Author.objects.annotate(total_books=Count('books')).filter(total_books__gt=5)
When the data model of a project gets bigger, writing queries by hand gets harder to think about. Perhaps its due to my own overreliance on ORM's: but I can't fathom how I'd manage without them. Because in practice the data models are far more complex than above, and it'd take a lot of time (not to mention mental energy that could be put to use elsewhere)Also, there are ways around performance problems: For one, it may entail rejecting features offered by the ORM. Such as django's content types, multi-table inheritance to instead use abstract inheritance (basically just reusing common fields) and even plain one-to-one relations. They're just too complicated and slow at scale.
Same goes for extending the ORM with stuff like django-polymorphic (and django-model-utils). I've gotten nice performance out of django-polymorphic (and cleaner code), but it's hiding a ton of metaprogramming, there's still a penalty "upcasting" naive models, and they're very burdensome to maintain if APIs fall out of date.
Next is trimming down queries with prefetching, only(), and doing direct ID lookups. This prevents multiple queries from piling up by doing the join ahead of time, only getting fields asked for, and doing the fastest lookup for objects after a more expensive "filtering" query has ran.
Here's an example of the query earlier, with .only():
Author.objects.annotate(total_books=Count('books')).filter(total_books__gt=5).only('id')
And to print the SQL query out: print(Author.objects.annotate(total_books=Count('books')).filter(total_books__gt=5).only('id').query)
That would then be used in something like: BookSet.objects.filter(book__in=Author.objects.annotate(total_books=Count('books')).filter(total_books__gt=5).values_list('id', flat=True))
And finally, for debugging certain types of query performance, django-debug-toolbar is nice. If its API calls django-silk can "look back" on background requests.The article was fair IMO, but I'd wager ORM's payoff depends on the ecosystem. Software being about tradeoffs: the convenience outweighs the downsides everytime for me. Maybe I'm to be humbled and find I'm not getting the big picture, and it could be just plain learnt-dependence, but it'd be a step back in productivity for me not to have an ORM.
comment 7y ago · link · parent
Windows 10 support for things is fantastic. It's faster than Mac OS X and Linux for me. It multitasks better. The HDPI support is very mature compared to Windows 7/8. Multi-monitors just work. I love snapping windows (via corners and hot keys). Also Windows Key + Shift + S to click+drag screenshots to clipboard.
Everything just works. Or the driver is a Google away. Wireless printers and scanners. Bluetooth headphones. Apps like slack, trello, spotify.
While I haven't used the Surface, I was considering one for development, but the repairability on the Surface Book 2 (if that's what you mean) is worse than the Macbook Pro: https://www.ifixit.com/Teardown/Microsoft+Surface+Book+2+Tea...
On the other hand, Windows 10 "just works" on a lot of hardware. I recommend Lenovo X and T series. Dell XPS series are getting good reviews.
WSL: I'm running webpack via npm, postgres, django and flask. I keep the project files in the windows layer and symlink it into WSL. I turn off Defender because it's the only way to work. WSL is far too slow for me to use Defender on.
Despite that, I turn a lot of call home stuff off. There's tons of telemetry stuff that adds no value. I tried W10Privacy and OOSU10 for it. I wish Microsoft would just add a button to turn all the cloud cruft/call home stuff off.
There is a nasty issue where running rm -rf node_modules that can cause the system to freeze. So go into explorer to remove that with shift+delete. Sometimes I still have to restart.
Microsoft has won a lot of confidence from me with Windows 10, VSCode, and WSL.
comment 7y ago · link · parent
Books:
How to Win Friends and Influence People and How to Stop Worrying and Start Living by Dale Carnegie
Taste testing:
PhilosophersNotes is like sparknotes for self-help books. Can be used as a way to discover / screen books you'd like.
Audio:
Psychology in Seattle's episodes regarding Attachment Theory (6 episodes). The reason why is it's a swiss army knife for understanding relationships and behavior. These episodes are paywalled though, but there are free episodes available if you use a Podcast app.
Like aphextron mentioned Socrates: Republic, Apology by Plato are really good. The one narrated by Ray Childs.
Audible for Zen and the Art of Motorcycle Maintenance by Robert Pirsig (it's like a Socratic dialog about what Quality is)
A lot of stuff by The Teaching Company / Great Courses in general have been good quality (maybe I've been lucky).
comment 7y ago · link · parent
~/.local:
It's intended to be /usr/local in the user's home directory. There's a bit of a backstory here though: Linux distros don't follow `/usr/local` as well as BSD's, not much may be there.
~/.local/share:
Same idea, for /usr/local/share. But on many linux distros, this is `/usr/share`. XDG is trying to do is mirror the system directories in the user's filespace.
Let's assume there's going to be a lot of applications: they won't agree on where cache, config, and data storage is kept at within ~/.myprogram. With XDG, if someone wants to clean out all their cache files? rm -rf ~/.cache.
The other thing is: Typically the user won't be looking at ~/.local/share/myprogram - it's for data the application itself is going to use. It doesn't really count against it. What I think we will be looking at though: configuration files. That's where I think XDG is kind of original - but it's really close to what /etc is.
As for ~/.myprogram: I'd be okay with that, if it were purely configuration. But XDG serves the article writer's purpose fine: Keeping $HOME clean. I kind of think splitting between ~/.config, ~/.local/share, and ~/.cache ends up feeling more consistent with how linux/bsd organizes files.
comment 7y ago · link · parent
The reason I like it is it provides directories to use across platforms (edit: Not sure about Windows), relative to the user. Since the applications download a file (UNIHAN database [1]) to bootstrap, we want to store it in the user's files, not the systems. The other thing I do that's helpful is using sqlite (which is often built with Python).
This combination gives a database, and a place to store configuration, downloaded/built files, in an organized way across systems.
The nice things XDG "standardizes" which I'm using:
$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
$XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.
Why the implementation is helpful:
It defines a common directory for cache/data/config files, with applications inside them, e.g. ~/.config/i3, ~/.config/tmuxp, rather than adding more stuff to ~/.i3, ~/.tmuxp. When standards aren't being followed, programs end up storing their configurations / data / etc all over.
Another thing is it defines directories relative to the user themselves and for the system files. Dotfiles may imply configuration / artifacts in the users home directory, it doesn't have. The thing I like is I can check for configuration in user files (for instance ~/.gtk-3.0/), then fall back on checking the system files (/etc/gtk-3.0).
The benefit of user files is they're writable out of the box, so if there's going to be any file generated that the user needs to keep (like an unzipped version of UNIHAN) that can be cached so they don't have to download it again.
(XDG Link: https://specifications.freedesktop.org/basedir-spec/basedir-...)
comment 7y ago · link · parent
Merely giving back in any sense helps. Sometimes open source patches are not important in themselves, but taken as a whole make a big dent: A good portion (1/3? 1/2?) of my contributions are very trivial (typos, package updates, etc.)
I use a few things to track open source contributions: OpenHub (https://www.openhub.net/accounts/git-pull), and a new thing called sourcerer.io: https://sourcerer.io/tony.
It goes back to my first patches which were tiny and failed to conform to the project's code standards :P I hope this can be encouragement that little wins build up.
There are also projects I've made that I personally deem important, but aren't known or are in a niche space. For instance, unihan-etl (https://unihan-etl.git-pull.com), a tool for extracting UNIHAN (https://www.unicode.org/reports/tr38/). If someone is in a situation where they need an extraction of Chinese/Japanese/Korean unicode characters, this tool can save them a lot of time.
There's more to the story: It's also a building block of a larger project, cihai: https://cihai.git-pull.com. I am planning on making this project a spiritual successor to Christoph Burgmer's cjklib (http://cjklib.org)
comment 7y ago · link · parent
- CMake, yay! These make generating build files for a variety of platforms (even Windows) a breeze. It also works with code completion stuff (CLion IDE, KDevelop both have CMake-based projects)
- I like how it splits stuff up as well (https://github.com/klaussilveira/qengine/tree/master/src/gam...).
- As for vendorizing SDL2, there is an opportunity for optimization: The shared libraries and header files can be scanned through CMake scripts. Example: https://github.com/tcbrindle/sdl2-cmake-scripts.
- I see the .clang-format file, nice! (This is for clang-format: https://clang.llvm.org/docs/ClangFormat.html)
Unfortunately, license is going to be a real barrier to most game developers. The ironic thing is this engine includes SDL 2 which prides itself on being on a permissive license. (https://youtu.be/MeMPCSqQ-34?t=405, 6:40 to 7:30)
If it's the intention to create an open source library to be helpful as possible to developers. If it's the intention to have a library just for use in the GPL ecosystem of games (which isn't bad: OpenTTD is GPL!) then this is okay.
The reason why is a private game developer want to retain control of their intellectual property, even throughout the prototyping phase.
As for open sourcing, I'd approach it in a different way: I'd release reusable components under a permissive license (e.g. MIT, BSD, ISC, zlib, etc.) and keep any creative work product code/source files private.
Similar SDL2 framework for 2D games (I made some CMake contributions a while back): https://oxygine.org/
comment 7y ago · link · parent
I love this service as a publishing solution. You can write markdown and get your book updated to dropbox (while you write it/push it to VCS) and then publish directly through them to epub/PDF. But the other nice thing is they can export Amazon-compatible files so you can publish to Kindle.
They also offer a very fair and transparent royalty structure. I found Amazon could be a bit greedy. The reason why is when a book goes above 9.99, they increase the royalty significantly.
The only other tidbit I have to say is:
I also considered using sphinx-doc as a route to build the book. I haven't found a way to offer an appealing LaTeX (theme? template?) that'd work with it. If you do know LaTeX well, and have time on your side, maybe sphinx-doc could be down your alley. It can build to HTML, PDF, and epub.
As far as distribution goes: My experience with Apple's book store was very cumbersome. Difficult to get support, and in one case there was a glitch that unpublished the book.
comment 8y ago · link · parent
If you want to hop on board a rolling release, firmware-buster-DI-alpha3-amd64-DVD-1.iso will give you a fully working debian testing install with closed source drivers.
(Weekly builds are known to fail from time to time)
Then, pair that with a sources.list generator: https://debgen.simplylinux.ch/
And one more ingredient: if you use gnome 3, you may have to copy a file to get gnome extension installation via chrome working. Copy the contents of /etc/chromium/native-messaging-hosts/ to /etc/opt/chrome/native-messaging-hosts/.
A bit off topic: for gnome 3 extensions, this has been indispensable: https://extensions.gnome.org/extension/723/pixel-saver/
For tiling window managers, I recommend i3: https://i3wm.org/
comment 8y ago · link · parent
Agreed.
For a bit of an optimization to that:
- https://github.com/rainux/vim-desert-warm-256
Not many stars on it, but works on a few machines without needing to have extra stuff installed.
comment 8y ago · link · parent
UNIHAN is Unicode's Han Unification effort. It handles the variant issue - but actually also goes a step further, citing information from paper books, including stroke information, definitions, and even pronunciations [1].
I've compiled a overview of UNIHAN at https://unihan-etl.git-pull.com/en/latest/unihan.html.
unihan-etl is a project I've created that allows extracting the contents' of UNIHAN's database: https://unihan-etl.git-pull.com. It can be used as a Python library, or a self-serve export of the database to a tabular or structured format.
In addition, there is something I've worked on to make this data also available in SQLAlchemy / DB form: https://unihan-db.git-pull.com
And also using it as a basis for a spiritual successor to cjklib [2]: https://cihai.git-pull.com
comment 8y ago · link · parent
If you like Python, tmuxp (https://tmuxp.git-pull.com) and libtmux (https://libtmux.git-pull.com) could both use maintainers.
In addition, any project on the sidebar of https://www.git-pull.com would help from a maintainer.
If you like the Chinese / Japanese / Korean language, another promising project I have (which has yet to gain traction) is https://cihai.git-pull.com for CJK-related language tools. I am designing it to be a successor to cjklib (https://pypi.python.org/pypi/cjklib)
comment 8y ago · link · parent
I think it could be natural. A lot of smart interlinking of posts, clustering different niches, and posts being spread across social websites.
I can even give a direct example. My book The Tao of tmux is available for free online. It used to be in the google top 10 for tmux. Now, a newer article on HackerNoon is up at the very top: https://hackernoon.com/a-gentle-introduction-to-tmux-8d784c4...
I think people just like the Medium posts, heh. They made a publishing platform that attracted talented writers, and the feedback loop with readers seems to be encouraging it to grow.
Medium actually hampers my personal efforts since I keep my own static website and wrote a custom blog-like application I post. I feel I may end up having to move writing efforts there since the velocity there is so big.
P.S. NYTimes digital team uses Medium: https://open.nytimes.com/ I think that demonstrates to me people just like the product and it's going to self-perpetuate until someone devises something better.
comment 8y ago · link · parent
But my point is that stuff like Aha, at a smaller startup, can articulate business goals / customer stuff to individual issues on Github/Pivotal Tracker. That in itself is a software solution that supervises itself.
Not every startup fits that. But I think if they were open to it they'd like it. There is a downside though, it's 74/mo per user. Ugh. That cost.
https://www.aha.io/product/pricing
But agreed on blockchain in itself not making much sense in this case. The only times I've seen it intertwined with issues was with open source, cryptocurrency places like Gitcoin.
> Other than that, it either falls into micro management or into a tech lead role. As soon as a manager starts getting involved in technical decision it usually goes against the tech lead of the team or architect. If a manager asks for status updates constantly it's pure micro management and against the Project Manager.
You articulated this a lot better than I could. This is where I've seen manager's occasionally can harm more than they help.
comment 8y ago · link · parent
Tools: at Boostable we had Aha (https://www.aha.io/). And we would have the founder Alex split the tickets up. Aha would disseminate the tickets into Pivotal Tracker (https://www.pivotaltracker.com/).
Aha played a really big role in top-down delegation of tasks and equating them to business objectives. That software is pretty cool and I recommend checking it out, because I think in some cases it can make manager's redundant.
After that, it was autonomous. I created a lot of issues by myself directly in Pivotal (which probably lends to them not being recognized officially, since Aha was where the business impact was overviewed)
comment 8y ago · link · parent
Their time should be spent listening to customers, directors, and other stakeholders to check if they're sorely missing things. They should keep lines of communication open and be proactive.
One thing we don't see often enough is the "Principle Software Engineer" role in startups.
At most startups, it's an open office floor plan. The data analysts, sales person, and marketer would come up to me with a request for something that was actually detrimental to their doing their job, but it wasn't getting focused on in our sprints.
At Boostable (W14), I was handling all server / e-commerce / front-end issues, plus setting up systems for marketing and sales needs that wouldn't have otherwise been done. And it brought substantial value to the company, for low hanging fruit a manager would have kept kicking the can down the road.
The issue is, these proactive things were never recognized or appreciated the way I think they should have been. Heh. It's as if it the work being unofficial made it less valued, when the way I saw it, it was shared success.
If a programmer is impactful and setting the best practices for the team, they can report directly to VP/CTO. Less supervision. Mentor fellow employees.
comment 8y ago · link · parent
Some of the things I like: customer first, open source contributors, remote-friendly, open communication, etc.
But the thing is, KeyValues let's you pick stuff you like, based on stuff employees generally look for. And it shifts more burden onto the employer to define and explain their culture.
I think employers would fare better if they holistically evaluated people.
That part of shifting the employers to think and interact more is essential. Just throwing around code golf while they accept 1000 resumes and repost every month, when only one space is open - isn't a talent quest - it's spurning a class of sincere developers who are job seekers.