Imho "source" is an anti-feature. I think instead of "source", you always should create a subshell. It properly encapsulates your modified environment and avoids leakage and confusion. Exiting an environment is a straighforward exit/<ctrl>-D like with any shell. You do not need to remember a special "deactivate" command like with virtualenv.
I swear by subshells. They solve so many problems. People object that they don't let you do environment autoloading on `cd`, though (which I also hate, so... Yeah).
I have several bash functions that need to be sourced to be included. For instance, I use `cdc` to change to my code directory, where I keep my source for projects I am working on. If I type `cdc name` it changes it to my projects source directory, save me a lot of keystrokes in a day as I have many that I flip between. This sourcing of a function is required due to the way cd is handled, and in it's current form, not directly usable under fish. Maybe it's easier under fish, but fish isn't backwards compatible to make this work out of the box.
CDPATH is not a very good bookmarking system, as you can't bookmark several directories that have the same name, and you are forced to bookmark all the siblings of the item you wish to bookmark, which can be a problem with flat hierarchies. So if bookmarking directories is the goal, CDPATH might not be the best way. And one off bookmarking functions are easy to write.
Admittedly for the description given, it does sound like CDPATH would work. But I'm going to assume there's a reason, and functions that change the current working directory are the perfect example of functions that can not be run in a subshell, so will have to be rewritten to fish, which is what the author was providing.
I simplified the example, cdc does more than just a change the directory. `cdc -t name` changes to the directory and attaches to the tmux session of the same name if it exists, and if it doesn't, sets up my tmux layout for development.
whilst reading your above comment i wondered why you chose not to use environment variables instead. e.g.:
$ export cdc_stuff='/Users/me/src/project_stuff'
$ cd $cdc_stuff
however, now it's clear.
in the event you're looking for alternatives, perhaps porting your code to (e.g.) ruby could work.
just in case, here's the isbn number of a book called, 'Build Awesome Command-Line Applications in Ruby 2,' from the pragmatic bookshelf: 978-1-93778-575-8
No, you don't have to use TypeScript, the angular dev team has been clear on this. You don't have to use atscript either. That said, typescript is pretty slick, and is essentially ES6+, I'd recommend giving it a shot before dismissing it.
Great. As far as I know there's no atscript anymore. So that's clear. But again browsing around https://angular.io/ one would read TS all over the place and, surprisingly, es6 is barely ever mentioned.
edit
I'm not dismissing TypeScript (in fact I love types being also a Scala dev)... I was just surprised Angular2 skips es6 altogether. That's it.
Actually, the ES6 and TypeScript versions are virtually indistinguishable, so it's not worth posting both on the site. The only difference being the types/interfaces are dropped in ES6.
You're correct, it's an ignorant argument, and I see it posted all over the place. I wish America had a better education system, because it drowns out the real conversations that should be happening around free speech.
You have the right to say whatever you want, you do not have the right to say it in my home. I'm curious as to whether or not these individuals understand this, or are just another level of troll trying to stir the pot.
Furthermore, I do have the right to say it "in public".
But, where is that "public" on the internet? I can make a website - a home - and invite other people to come visit me and listen to me ramble, or respond etc. But there is no public space, is there? And if not, should there be?
Most people don't own the homes they live in. Yet the landlord still doesn't get to tell them what to talk about over the dinner table. That's great, but imagine the government sold all sidewalks and public places to private interests, which dictated how you should dress and walk if you want to get out of your home, or to work. Should that be allowed?
Imagine getting thrown out of a mall because someone overheard and disapproved of your conversation there. Does that ever happen? I know there there is no clear line, but that there is one; e.g. if you trail other people and talk to yourself or a friend about them (especially if it's nasty and aggressive) in earshot, that's not exactly cool. But what, other than sanity, would stop all mall owners to agree that anyone e.g. declaring to like the color green should be kicked out, and to hire staff to enforce it? Would that be legal? If it was, should it be? And if it wouldn't be legal, why is that? In what ways, if at all, could or should this applied to the internet?
There are indeed public spaces on the internet, many governments and government bodies have sites that are public where you can file a petition or voice a concern.
Most people (63%) own their homes in America, and there are protections in place for people who rent. Your landlord cannot monitor you.
When it comes to the mall though, it's more a matter of scope and scale. Overhearing something in a mall affects a handful of individuals and the intent was not to broadcast. If you stand up on a table in the cafeteria and start spouting hate speech, you can and will be escorted out by security.
The internet is different, because you cannot accidentally overhear a conversation. Said anywhere on the internet, especial a place like reddit of HN, it is viewable by the entirety of internet users. So direct comparisons to the physical world will always fall short.
If you're looking for fair discussion about free speech, the US education establishment is the last place you want to look. They are completely overrun by PC moral panic, and not only real dissent and vigorous discussion representing diverse points is not welcomed, be it about free speech or any other topic, even mild critique from the friendly side or discomfort with exposure to unsettling thoughts is intolerable. E.g. see: http://www.vox.com/2015/6/3/8706323/college-professor-afraid
Check out this series of charts. Each method of contraception in its own chart, and "perfect use" and "typical use" are both plotted.
Out of 100 couples using a condom as birth control, 55 will have an unplanned pregnancy in 4 years with typical usage (8 out of 100 with perfect usage).
Circumcised men especially do not like to use condoms because it greatly reduces pleasure as their glans is already number and more worn than a normal penis.
and can teenagers get to the health department for free? :-/
you're coming dangerously close to quoting the vogon from hitchhiker's guide to the galaxy:
> There’s no point in acting all surprised about it. All the planning charts and demolition orders have been on display at your local planning department in Alpha Centauri for fifty of your Earth years so you’ve had plenty of time to lodge any formal complaints and its far too late to start making a fuss about it now.
> What do you mean you’ve never been to Alpha Centauri? Oh for heaven sake mankind it’s only four light years away you know! I’m sorry but if you can’t be bothered to take an interest in local affairs that’s your own regard. Energise the demolition beams! God I don’t know…apathetic bloody planet, I’ve no sympathy at all…
Competing anecdote: when I was a teen, I had no idea what the health department was, or what it did, and I never met an employee of the health department.
If you look at my github profile, you'll see that I'm in Oklahoma and because it's her job.
I'm sorry you didn't have access to taxpayer funded condoms when you were a teenager. Why so much criticism? Do you feel somehow that you were treated unfairly? If so, by whom?
Chill out, man. I'm not criticizing anybody. Just showing some incredulity.
When I said where and why, I meant in what context does a health department employee hand out condoms?
Like, does she wander around the area shopping malls with overflowing pockets, handing them out to anyone who looks like a teenager? I'm just trying to figure out how what you described works.
Only experience with the same problem space can make you accurately predict where a bottleneck is going to be. Premature optimization will have you focusing on areas where optimization isn't required. YAGNI applies to all levels of development.
I would rather see bloat and new ideas, than only experts working in a problem domain. My best ideas come from a marriage of understanding a single problem space, and a wonder what I can do in another. Bring on the bloat.
Familiar and comfortable syntax with C/C++/Obj-C/Java/Swift/Javascript/Typscript/Scala/etc... It's a procedural language, yet adopts functional elements. And the pool of developers is several orders of magnitude more. Your comment reeks of fanboyism.
I never like to criticize when someone creates something new. But decades of professional experience (having seen this concept come and go repeatedly over the years), taught me that HTML is your friend. I inherited a project that uses this concept, and there is no maintenance. Not because it's stable, but because it's more delicate than a faberge egg, so we never ever ever touch it.
I'm sure for some small projects with very infrequent layout changes, this could be nice to work with. But for any app of sufficient complexity, keep your markup out of your code be it through DOM construction or in string HTML. (React being the one implementation that MAY prove to be the exception to prove the rule, though it's too early to tell at this point).
I've had this criticism many times in the past, but after doing exclusively JS rendered DOM for about 5 years now, I personally could never go back.
I write large-scale web front-ends as my day-job, they used a number of tools, but the one thing in common is the HTML-free approach. It creates much more manageable codebases, encourages reusability, allows for easy composition, and massive flexibility.
You mention that you "don't touch it" due to decades of experience. Have a look at the example app (https://github.com/KoryNunn/fastn/blob/gh-pages/example/) as an example of app structure. Yes, it's a trivial example, but it's not really that different to the non-trivial apps I build at work.
I think it's great that you created something that you find useful and works for you, and continue to create it after receiving negative criticism. I also think it's great that you're putting it out there, and wish you well with it. I'll end with that, as I don't want to be harsh or overly critical.
> But for any app of sufficient complexity, keep your markup out of your code
I'd rather divide the app into components, each one with its own HTML, CSS and JS, plus the AJAX handlers on the server.
Simply separating HTML from JS is not enough. I remember having to hunt a lot from file to file when I was using jQuery to build websites, because the HTML was in one file, the JS was in completely other file. It wasn't efficient.
I think the declarative approach here, which seems inspired from ReactJS is the nicest. I don't ever want to write direct HTML any more. I prefer to use a fully developed language to declare the page. In such a language you can use repetition, functions and variables to express your markup in a smarter way.
There is a non-open-source JavaScript decorator library using this. It has many (real) examples, but the one that first comes to mind is its use of the xtype.is API method (http://xtype.js.org/api/is) to perform runtime validations based on validation meta-data that's defined in configuration.