yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Quickly Paste Your Code With Pasties


4m read
·Nov 3, 2024

Hey guys, this is Mac Head11 with the video on our new Mac app that we're releasing today. So, this app is called Pasties, and basically, it's a simple program that lets you post text to a pasting site.

So, right here it is in my apps folder. You can have a look at the icon. We go ahead and open this and when you first open it, it'll ask you to add it to your login items, but I've already done that since I've opened this before. So, it adds this thing to our menu bar. We just tap there, and let's check out the preferences.

So, our default language is the programming language that it'll put in certain places by default, and our default service is Pasty. It supports three services right now. We're going to hopefully add some more in the future. Then, you can have it auto-detect the language; I'll show you that later. And, start Pasties at login. If you don't have this enabled, then this won't come up whenever you restart your computer. You'll have to open it manually, so I highly suggest checking that.

Alright, so let's go ahead and create a new paste with Pasty and let's have a look at the interface. So, we'll tap on this button in our menu bar and we'll say "New Paste." It'll come up with a pretty simple window—a big text area. We can select our language; for the service, obviously, different services support different languages.

So, PasteBin's list looks a bit different than Pasty's list. I'm going to be using Pasty, and this is going to be Objective C. Here, we're going to write some code. I'll just write a simple "Hello, world!" program. Alright, and let's go ahead and tap "Paste." This little pasting window will come up, and once it's done, it'll bring this success message. We can just say "View," and the browser just flies up here in our default browser.

Pasty actually supports syntax highlighting; all of the services that we use right now do. So, you'll see that since we specified that it's Objective C, it's highlighted in a very nice way.

So, now let's go ahead and, um, I'm going to show you another feature that this has, and that's pasting from the clipboard. So, let's open up Xcode, and this is actually the source code for Pasties right here. So, we're in this file and I'll select all and I'll copy it.

So, let's say I've copied this source code to my clipboard, which I have. So, we can go here and say "Paste Clipboard," and I'll post it to my default service and my default language. As you can see, it's posted, and we just check it out in our browser—syntax highlighting works and everything. This is the file I just copied, so that's pretty cool.

Let's have a look and see what else we can do. So, there's a history; it records all the pastes you made and the time that you made them. You can obviously select some and delete them, so that's cool.

Now, let's check out the auto-detect language feature. So, let's go ahead in our preferences and let's just set this language to be plain text. Where is it? I can't find it—plain text!

Okay, so right now, if we were to paste my clipboard, let me just show you what it'll look like. Even though it's Objective C code, since our default language is plain text, there's no highlighting. It looks very ugly.

So, what we can do is we can go into the preferences and check "Auto-Detect Language When Pasting from Clipboard." Basically, this is what it sounds like: when you paste your clipboard, if it can figure out what language it is, it'll automatically tell the website what language. So, now if we paste my clipboard, even though I'm in plain text mode and my default language is plain text, it will know that it's Objective C and Pasty will then be able to highlight my code correctly.

So, that works for pretty much all the services pretty well. There are a few bugs, like for instance, PasteBin has something called spam detection, which if you have links in your code and you paste something, it gets mad and the paste doesn't actually go through. So, I wouldn't suggest it. I just don't like PasteBin anyway. PasteBay and Pasty are probably your best bets for pasting services.

So, this is just a cool little utility for all the programmers out there. It's good for IM chat specifically because you can't necessarily send code, and even if you can, it's going to be formatted in a horrible way. So, this is a pretty useful app. I've already used it a bunch before I even, you know, just testing it out and everything.

I've had it running for the last couple of days—just using it on and off. So, it's a really cool app! So definitely check it out. The link will be in the description to download it, and the source code will be available on Git. It's already on Git, by the way; some of you may or may not have noticed that.

So, anyway, thanks for watching MacZ 101. Subscribe and goodbye!

More Articles

View All
TIL: How Cookiecutter Sharks Eat Is Terrifying (Explained With Cookies) | Today I Learned
In the same way you might take a Christmas tree and stick it in dough and have perfect edges, the cookie cutter shark is able to do this with its teeth. A cookie cutter shark is sometimes known as a cigar shark because of the shape of its body. They’re de…
_-substitution: defining _ (more examples) | AP Calculus AB | Khan Academy
What we’re going to do in this video is get some more practice identifying when to use u-substitution and picking an appropriate u. So, let’s say we have the indefinite integral of natural log of X to the 10th power, all of that over X, DX. Does u-substi…
Kevin O'Leary Shops for AFFORDABLE WATCHES | Ask Mr. Wonderful
Welcome to another episode of Ask Mr. Wonderful! And guess who I’ve got with me? You’ve met him before. Teddy is an absolute author of great work on watches. I love him; I love his depth of knowledge. But you know, we talk so much about really expensive p…
Appositives | Punctuation | Grammar | Khan Academy
Hello grammarians and hello Paige. Hi David! So today we’re going to be talking about the appositive, which is just a monster of a word, right? Uh, I can tell you that from my limited study of Latin, right? It comes from “ad positio,” which is like putti…
Worked examples: Calculating equilibrium constants | Equilibrium | AP Chemistry | Khan Academy
An equilibrium constant can be calculated from experimentally measured concentrations or partial pressures of reactants and products at equilibrium. As an example, let’s look at the reaction where N2O4 in the gaseous state turns into 2NO2, also in the gas…
Short run and long run equilibrium and the business cycle | AP Macroeconomics | Khan Academy
What we’re going to do in this video is talk about the notion of equilibrium in a macroeconomics context. So let’s review a little bit of what we’ve already studied about aggregate demand and aggregate supply. So this vertical axis here, that is the pri…