Jerod, Nick, KBall, and Chris pre-party for JSConf by testing out some brand new segment ideas: Story of the Week, What the WHAT… WG, and Protip Time. What do you think of these segments? Like ’em? Love ’em? Not sure why we even? Please let us know!
Christopher Hiller: I have some pro tips… I use a Mac. If you use a Mac, maybe a thing you need to do is copy and/or paste text files (source files or what have you) in their entirety. I discovered not too long ago - maybe this is one of those things that everybody knows except me, but I discovered that there were actually a couple command line tools that come in Mac OS that help you do just this thing. They are pbpaste and pbcopy.
[52:16] Pbpaste outputs to a STDOUT. It takes whatever is in the clipboard, and it sends it to STDOUT so you can pipe it to whatever you wanna pipe it to. Maybe you wanna pipe that to a file, and so if you copy some source and then you go to your command line and you say pbpaste, and then you do a write – I don’t even know if that’s less than or greater than [laughs], but you’re piping to the right with the direction, and you say foo.js… It will paste the contents of your clipboard into a new file, foo.js.
I wrote a little tiny Zsh function called Paste, which does just this - it takes its first parameter and it says ‘pbpaste’, and it writes to this new file. So I say ‘paste foo.js’, it takes whatever is in my clipboard and throws it in a new file, foo.js.
Likewise, pbcopy - you can cat a file and then pipe it to pbcopy and that file’s content will end up in your clipboard. Again, I wrote a little function to help with that, so it just accepts its first parameter, and it cats it (this file) and it pipes it off to your clipboard, which is really cool.
Along the same lines, there’s another little thing called z, and people may or may not know about z; maybe we’ve talked about z before, I don’t know… But there’s this command line tool for your shell called z. Just search GitHub for z.
It basically looks at all your shell history, it looks where you’ve been, and if you say something like “z node” or something, it will find the last directory that you were in called Node and it will just pop you right back there. It’s a great way to navigate to frequently visited directories or working copies, and it’s really neat.
Another tool I use is called – and apparently there’s science behind this; I can’t say whether or not that’s true, but it’s brain.fm. It’s a service that you pay a nominal fee for and they give you a mobile app and a web app. The best way to maybe explain it is it’s generative music; there’s many different styles, but… There’s some science behind it that says “If you listen to this music, it’ll help you, for example, focus on a task, or it’ll help you relax because of various tones and tempos and frequencies in the music.”
I don’t know about that, but I wanted to try it, and so I did try it, and I found out that it’s really helpful when I’m trying to focus on coding, and it helps me get and stay into the flow.
I feel like if you do a lot of coding, maybe you recognize that sometimes you get into this flow state and I feel like the music generated by brain.fm may help you do that; maybe it won’t, maybe you’ll find it boring, but it’s supposed to be actually kind of – it’s not supposed to engage to engage with you. It’s supposed to be kind of in the background.
A lot of popular music, or even maybe you listen to – I don’t know, techno, or trance, or something with that beat… It kind of drives you forward to help, but maybe sometimes that type of music is a little too engaging, and the brain.fm music is like Techno Elevator music, or something… It’s really interesting; you just throw it on the background, forget about it… And it helps me focus. Check that out, it’s cool.
[56:31] The last thing - there is a thing called Astral. If you’re like me, you have a million GitHub stars and you may be like “What was that thing I was thinking of? How do I find it?” I don’t even know how to do that with GitHub… So there’s this app called Astral App. It’s astralapp.com. It’s just like an OAuth style GitHub app, and it helps you manage and view all your stars, and you can even tag your stars into categories, and it sorts stuff by language, and it’s really neat.
So if you are like me and have a lot of stars, check out Astral App, and that will help you manage them and find things. Those are my pro tips.