You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🎯
Focusing
Antwan R. Wimberly
armw4
🎯
Focusing
I'm interested in F#, python, .NET, JavaScript, React.js, Functional Programming, Go-Lang, The art of Inter-process Communication, and more. Thanks!
I'm a huge fan and heavy user of Vim (I do all my ruby and open source development there...anything that' not Microsoft basically). I happen to use what I like to refer to as a "Vim bootstrap" in Steve Francia's awesome spf13.
It has sane defaults and comes equipped with the latest and greatest Vim plugins on the market.
After installing the bootstrap, you'll want to ensure you keep it update to date just like Homebrew formulas, ruby gems, and npm packages. It's prett easy to upgrade your bootstrap, but who really has enough RAM in their brain to store that curl command? Sure you could drop it into a script, make it executable via chmod, and put it into some folder that's attached to your $PATH variable, but I've yet to cross that bridge. I do know however that I've executed that command numerous times and that it should be stashed somewhere in my zsh history. I know it contains the string "curl", so I whip
I finally figured it out (probably could have just ready the documentation, but who has time for that when they're gluttonously binging on source code)?
It's just a platform independant way of creating a path. It's abstracting the proper separator for you (which is either a backslash or forward flash depending on whether or not you're on *nix or Windows). It's even smart enough to not add a slash to the path if any of your arguments already contain it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working with streams in node can be a scary and daunting task. The first time I saw the stream handbook, it left me quite perplexed. After seeing stuff like
through, through2, and @acrute doing some stream kung fu on the job, I knew it was time. Streams are actually pretty straightforward once you get the hang of things. Read the handbook
and the node docs and eventually your epiphany shall be born. I think one of the most confusing things for me was that Readable
streams are for reading values that are produced by you, while Writeable streams are for dealing with values that are to be
consumed by you. Say I wanted to put (write) some data from another stream into a file, and I wanted to take control of this process.
Or say I just wanted to log (write) the results of a stream to say the console. These would be prime for Writeable
Array.prototype.slice is a widely used function in JavaScript. It's typically used when you've got a variable list of arguments (VARARGS...popular in ruby *). The reason you always see slice invoked with 0 is because that's the start index. Think of substring if that makes more sense.
Setting instance variables in ruby is all about the current value of self. Just because you use @foo = bar...doesn't mean you'll get a new copy of foo for every instance of your class.
classHiOdefprint_i# note...this won't print 12...even though we set# this variable in the `toast` methodputs"my var is #{@var}"# and neither will this...failure!!!
Ruby is such an incredible programming language. One of the cool things I like about it is mixins. You can declaratively add behavior to a class in a very ad-hoc manner. It's so cool....again! One great opportunity I can think of for mixins is when you need to opt out of a base class's functionality in a very DRY (Do No Repeat Yourself...aka...n…