I use Makefiles for every Python project, personal and professional. Maybe there’s a better way, but it works for me and my teammates quite well. Here’s a redacted example from a recent one:
PROJECT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
PROJECT_BASE := "somebasename"
PROJECT_NAME := "someprojectname"
VERSION := $(shell grep "version=" setup.py | sed --expression="s/.*version='\([0-9]\+\.[0-9]\+\.[0-9]\)',/\1/g")
.PHONY: env
env:
@virtualenv env --no-site-packages
ifneq "$(VIRTUAL_ENV)" ""
.PHONY: setup
setup:
@python $(PROJECT_DIR)/setup.py develop
@pip install --upgrade --editable .[tools]
.PHONY: clean
clean:
@find $(PROJECT_DIR)/src/ -type f -name '*.pyc' -delete
.PHONY: test
test: clean
@nosetests --nocapture test/
.PHONY: lint
lint: clean
@pylint setup.py $(PROJECT_DIR)/src/$(PROJECT_BASE)/
endif # VIRTUALENV
.PHONY: version
version:
ifdef tag
@echo "Setting version to $(tag)"
@sed --in-place --expression="s/$(VERSION)/$(tag)/" $(PROJECT_DIR)/README.md
@sed --in-place --expression="s/version='$(VERSION)'/version='$(tag)'/" $(PROJECT_DIR)/setup.py
endif
@head -n1 README.md
So now all common tasks are at your fingertips, make env, make setup, make lint, make test and bumping the version with make version. Usually have a bunch of other stuff in there too once the project gets going, maybe make server and stuff like that.
I enjoy the style that this book is written, and have already been on an Elixir self-study regimen. Question for author or anyone who’s gone through this already: the beginning seems to be very beginner oriented, is there added value later for experienced programmers coming from other languages?
It says “a gentle introduction to programming” so I think it’s for beginners.
If you are experienced in another language, you can get by by reading the official documentation’s guide in the Elixir website and messing around for a bit and going straight into OTP with a book like Little Elixir and OTP Guidebook. Aside from that, there’s the Elixir book on PragProg but I also found it too basic.
The LE&OG is a great find and just what I was looking for, thanks!
The Lies of Locke Lamora, the first book of The Gentleman Bastards series.
It starts off slow and seems more like Oliver Twist than a fantasy novel, but its charm pulled me in. Over time the fantasy elements and broader scope start to work their way in and by then I was completely invested in the characters and their plights. It’s a unique take, about 2/3 through but I can already highly recommend.
The code examples are really wonderful to back up the points he’s making. I’ve only dabbled with Erlang/Elixir but am bookmarking this to see how I can apply these techniques to current problems I’m trying to solve with small one-off scripts.
I’m a simple man, I use Simplenote for pretty much everything since it’s available on all my devices and… simple. I have a note titled {company_name}: STATUS that’s just a long list of dated sections with any notes I take that day, including notes from standup and such. If anything ends up being too long or worth keeping a handy reference to I’ll break it out into another note like {company_name}: {some_app}: troubleshooting or such and reference the title in the STATUS note. You can see a lot of the value comes from naming convention for the note titles.
I really do use Simplenote for everything from work, to grocery lists, to music I want to check out, to Minecraft base locations, etc.
I never understood the power of currying either until I started using Clojure heavily for stream processing. Now I use them so much by default I think about how to construct partials for their versatility in use. For example, I can have a single function that creates stream processors based on various rules loaded from configs at startup. That way, the creation of the stream processor only occurs once at startup when the first argument is passed in, improving performance when the returned stream function is called since any config processing has already occurred. A generalized sanitized example:
(defn process-rules
[rule-fn & downstreams]
(fn [event] (apply (rule-fn event) downstreams)))
(defn apply-rule
[rule event]
(...do some stuff with rule to process event...))
(defn create-stream-processor
[some-rules]
(partial process-rules
(fn [event] (map (fn [rule] (apply-rule rule event)) some-rules))))
I may have sanitized too much for that to make sense or parse correctly. But the point is also, if you’re not used to currying regularly, this might not even make sense regardless, let alone be the first way you’d think of approaching the problem of stream processing.
That is nice. It is true it takes sometimes to get used too, but when it clicks, it clicks!
I also have to get started with Clojure. Especially after I saw some benchmarking between go, nodejs, and Lisp like languages!
Interesting idea. Curious that this only resulted in 4 lines of output even when I let it run for a while though:
while true; do date +'%s'; sleep 1; done | nc seashells.io 1337
[Comment removed by author]
May be related to their decentralization initiative.
Is Mozilla considering doing yet another thing that pretty much nobody wants at all
If they did, why bother with a survey?
I’m new here, so is this only about downvoting comments or also threads? I can only downvote comments, but I suspect this is because of my low karma.
P.S.: I also wanted to write “Can’t upvote this thread enough” but realized it would have been a “me too” ;-)
A little spelunking might help…
(I’m so close…!)
The only thing that keeps me sane is using weechat to connect: https://github.com/wee-slack/wee-slack
I relay it over to Emacs using https://github.com/the-kenny/weechat.el which is almost as nice as my regular IRC client.
Author of weechat.el here. Any feedback? I’m aware of performance problems when connecting to a big list of channels, as well as the missing auto-fetch history. Anything else you’d like to see? :)
Thanks! The only thing that confused me was that it seems to use a white face for your own nick, which makes it invisible in the default color theme, so I had to remove "white" from weechat-color-list. Easy fix once you realize what’s going on, but very confusing at first.
Also I’ve noticed sometimes the unread-tracking is a bit unreliable. However, this might be because I sometimes keep the web client open, and I’m not sure how that interacts with unreads. I will try to see if I can get more details about this and report an issue if so.
As for the color: Yes, we just copied the original colors from weechat itself, which is made for a dark theme. I’ll add a task to my list to create a more compatible color theme for bright emacses.
When I developed weechat.el there wasn’t an acceptable way to sync unread status. I haven’t tracked the relay protocol for quite some time now, but I’ll check if it’s possible now. It’s actually a feature I’d like to see too.
Oh, one thing I just remembered is that it was very surprising to me that weechat-tracking doesn’t track unread messages at all by default but only tracks mentions. It would be helpful to make that clearer or make the default match other clients.
I did this for a while, but then it felt like my irc safe-haven was infected by slack and it made me sad, so I stopped doing that. Now at least if I’m staring at a terminal I can be in my happy place and properly brace myself before I switch to a browser window.
Personally, I use the web client. It has almost all the features of the desktop client and I can turn off desktop notifications, making the only actual notifications, then, the favicon updates which aren’t nearly as jarring.
I think I’d prefer to use something else entirely, like your setup, but for some reason I’ve not taken any time to try it out. I do fear that I might become complacent or something and forget that I hate slack… because I’m not actually using slack, I’m using a chat service that feels like irc, and that’s dangerous.
Slack actually bothers me more because the model is fundamentally different than what I’m used to–1 network, multiple channels. Where as in slack there are multiple networks and multiple same topic channels. “But, irc has multiple networks, too?” Yes, but the official communities will hang out on freenode#lobsters, or freenode#racket, or efnet#mtg (idk?), not create a whole network about golang, and then have a separate channel, in each network, about Battle Star Galactica, essentially making BSG discussion so bifurcated it doesn’t even happen anywhere.
It has almost all the features of the desktop client
Because they’re the same thing. Thanks Electron!
Of course! The things that don’t work tend to be the shortcuts for switching rooms, or searching, and things of that nature–which is fine. The harder it is for me to waste time chat the less I’ll do. Get those conveniences outta my life, dammit!
I’ll need to take a look at this. It won’t help that much, but it’d at least make extracting/searching a lot easier than the official client. Thanks for the suggestion.
There’s also https://github.com/yuya373/emacs-slack ( also packaged as a spacemacs layer - https://github.com/syl20bnr/spacemacs/blob/master/layers/+chat/slack/README.org )
I tried to get that working first, but it was extremely unreliable at the time. Maybe it’s gotten better; this was about 6 months ago.
I’m extremely tempted, in my bid to not use graphical apps unless required, to connect to slack via the IRC bridge using suckless’ ii to script some grepping for notifications and piping those to dunst. I have a very hard time not responding to the shiny dot saying “NEW CONTENT HAS APPEARED.” I’d rather make it deliberate to catch up on content once every 2 hours (that’s only 4 times a day) for some timeboxed period of time than constantly monitor it. Bonus: More free ram.
An extensive list! I never knew about gx either, seems like that should be included in vimtutor
I can’t seems to get breakindent/showbreak to work as described, it just prepends each wrapped line with \\\… does anyone know how to get this to work?
They might have some issue going on with the blog post formatting, maybe it’s meant to be 4 (escaped?) spaces? Instead of setting showbreak to 4 spaces, you can set breakindentopt to shift:4.
Here’s my config:
set breakindent " indent wrapped lines, by...
set breakindentopt=shift:4,sbr " indenting them another level and showing 'showbreak' char
set showbreak=↪
No printers added to the list of things to remember.
Some things off the top of my head for someone who would want to remain anonymous:
Any other tips?
Considering she wouldn’t have been able to bring any devices into the building or any documents out, many of those avenues would have been impossible.
In addition to keepalive, you know when you accidentally cat a gigantic log file over ssh and have to wait hours for it to scroll by or kill the session? mosh prevents this and jumps to the end of the out. Granted, you lose scrollback due to this, so it’s a tradeoff.
I like that. This feature encourages me to switch to mosh. Does mosh support the same features that latest OpenSSH client supports? I mean ProxyJump, ED25519, reading from .ssh/config etc.
Not sure about the prior two (although I suspect both work, just never tried) - it definitely reads from .ssh/config tho
Mosh keeps the session alive when my laptop sleeps or I close the lid, so I don’t have to re-authenticate. If I lose the session over regular ssh, then I believe the tmux instance would die instead of simply detaching, so I wouldn’t be able to resume anyway.
tmux is for N-to-N sharing of a terminal: run multiple programs on the server at the same time, see them from some number of clients, isolate them from client-server connection termination.
mosh is for making client-server connections more robust. If you close your computer in one place and reopen it in another, it keeps going instead of needing you to hit up and enter twice to reconnect and tmux attach. This is invaluable if some part of your link is flaky, like oversubscribed conference wifi, or the connection between a moving vehicle and a terrestrial network.
Number 1 and Number 11 seem to be contradicting each other, but I suppose you could interpret #1 as saying “Don’t just say ‘I’ll fix it later’, but write it down.”
Whenever I encounter a situation like this, or a feature improvement that would be good in this spot, I always write a TODO, which is what #1 is saying. You need to keep track of these things or they’ll get lost.
Also, when on teams, I try to promote the format # TODO(sfz-): thing to do 2017-04-25 so that if someone has time to pick any up, they know who to contact for details or whether the issue might be stale or irrelevant.
The problem with that is people sometimes leave the organization. A slightly better version is to include an ID for your issue-tracking system that has more details.
I tried fish shell for some time and really wanted to like it. In the end, I went back to (my tweaked out) zsh for several reasons:
I still recommend fish to people who don’t use the shell much anyway, and have a much better experience with default fish than default bash or zsh.
Given the benefits and that it’s so easy to migrate from Apache to Nginx I’m surprised this isn’t way more divergent by now. Other than legacy support slash too lazy to change, are there any pros to Apache I’m unaware of?
Apache just works fine and is supported by Red Hat? I guess that covers also some of the “not switching” crowd.
Personally, I never saw the need to change to nginx, seems just as big and bloated as Apache, and not that easy to configure if you want to have a secure php-fpm deployment. If I’d switch then to something like OpenBSD’s httpd.
Nginx did not support loading modules at runtime until recently. In addition, there exists an Apache module for basically anything you could possibly want to do.
Seeing as I’m up this late only because I’m dealing with mitigating Kafka queue lag due to our big data team performing excessive complex queries on our OpenTSDB, this post couldn’t come across my screen at a better time, thanks! I’ll be interested in stress testing this soon. Has anyone here used this in a high-scale high-availability production environment yet?
Probably not as this seems to be in development still. You can read at the end of the document: “A clustered version is in private beta with select customers.” Doesn’t sound like production-ready. I would also like to have read something about cluster resizing and resilience to node failure, which are usually giant pain points in sharded data systems. Either way this seems interesting and I’ll be looking for excuses to try it out.
Here’s one that I never understood, the difference between time and \time. Maybe someone can explain:
~/time-test § time ls
command ls --color=auto 0.00s user 0.00s system 0% cpu 0.002 total
~/time-test § time -v ls
zsh: command not found: -v
[2] 5943 exit 127 -v ls
-v ls 0.00s user 0.00s system 0% cpu 0.001 total
~/time-test 127 § \time -v ls
Command being timed: "ls"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: ?%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 2440
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 105
Voluntary context switches: 1
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
~/time-test § alias time
zsh: exit 1
~/time-test § type time
time is a reserved word
~/time-test § type \time
time is a reserved word
\time ignores the shell builtin and uses the time binary on your system.
Since I don’t have a time, I get bash: time: command not found.
Bash has a builtin time and your distro/os has one, too. Run which time and you’ll see /usr/bin/time or similar; this is what’s run by \time. There’s probably a man page for it (man 1 time).
My guess, which time will point to something like /usr/bin/time, and \time is causing that to run instead of zsh’s builtin time. But IDK for sure, my system doesn’t have time installed as a program.
So what I don’t understand is why type, which and command -v all return time: shell reserved word for both time and \time then. The latter should return /usr/bin/time.
Edit: interestingly, which -a time returns both, so problem solved… sort of?
So what I don’t understand is why type, which and command -v all return time: shell reserved word for both time and \time then. The latter should return /usr/bin/time.
The shell’s logic for deciding between execing a binary or running a builtin understands ‘\’ as a quote of the string ‘time’ which results in supressing/escaping of the builtin behaviour. Evidently either type, which, and command are either ignorant of the meaning of ‘\’ or it may be stripped out by the time it gets to them.
Long story short, POSIX shells are a mess of inconsistent behaviour and squirrelly quirks.
I came across this editor performance comparison earlier today, seems relevant.
https://github.com/jhallen/joes-sandbox/blob/master/editor-perf/readme.md
VS Code is at or near the very bottom for every performance test.
On the other hand, VS Code feels faster than IntelliJ in my experience, and VS Code is straddling the line between Sublime Text and an IDE. YMMV.
I have been having a lot of success using Make to build my Docker-based microservices ecosystem of about a dozen services and about half a dozen backend servers. I also use Make to remember how to build and tag my containers to push to AWS ECR for deployment, which I would never remember how to do if I had to type it out every day.
You should probably be using Terraform for this, though the learning curve is a bit steep at first. Well worth it though to coordinate distributed infrastructure idempotently.