Repl Talk
A friendly platform to share and discuss all things repl.it
Announcements
Updates from the Repl.it team about the product
Pinned
🐶Introduce yourself! 🐶
Hi everyone! ![waving](https://storage.googleapis.com/replit/images/1561489787610_61c528ae0267ed2696f0c625ff66db6c.gif) Use this space to share anything you want to share with our community - your name, where you're from, what you program in, what brought you here... whatever you're comfortable with! Can't wait to get to know y'all. 💖 Katya
13
posted by katyadee (676) 2 days ago
Pinned
7
DEVELOPER SPOTLIGHT #06: “Work with each other, not against one another.”
## Welcome to *another* (slightly late!) edition of our Developer Spotlight series! This week we sat down with the founder of the volunteering app [Questlin](https://www.questlin.com),18-year-old Sam Miserendino. ![bag-and-hands](https://storage.googleapis.com/replit/images/1560884286154_5a6ca0b9e6e9ba5b685d81678547fa73.jpeg) **@katyadee**: Let’s start with the basics. Who’s Sam? **@samdevz**: Hi, I’m Sam. I’ve been programming since 9th grade. It’s always been my passion. There was as tudent at my school that I went to, and he was really involved in programming… He was making some popular apps, so that got me into it. I started with web development and a little bit of machine learning, and now I’m making apps and stuff. I use Repl.it basically every day, or almost every day, usually to test code or get things running quickly. ![D8-vEVOWsAAKiF8](https://storage.googleapis.com/replit/images/1560884332929_7bfc982a02a73230548f3418550d68fd.jpeg) I contacted Amjad in like…June I think? I was looking to do some work with you guys, or see how I could contribute in more meaningful ways, and he said unfortunately that there were so many interns this summer that they couldn’t take me, but we’re going to see if we can set something up next year, or maybe in the fall…so that’s really exciting for me. I’m just really excited about that opportunity—and also to talk to you! **@katyadee**: I actually had no idea! All I knew was about your involvement [WWDC](https://developer.apple.com/wwdc19/)… and I was really curious about what that was like. **@samdevz**: Oh, that was really exciting! I applied for the first time to Apple’s WWDC conference… usually it’s pretty expensive to go, and you have to enter a raffle, but for students they have a scholarship and if you’re picked, you can go for free. So I applied, and I won! **@katyadee**: For people who might not know—what is WWDC? **@samdevz**: Sure, so WWDC is Apple’s Worldwide Developers Conference. Over 5,000 people go, including 350 scholars. The main event is the famous Key Note, where they announce new features and products. It’s the main event for Apple Developers. The best part of it is you can meet the people who created these products. They have sessions all day long, and labs. So you can walk up to the guy who designed the Mac or the iPhone or anything—and they’ll give you really good feedback on what **you** can do to improve! It’s really a great resource for developers. **@katyadee**: What was it like to go as a student? **@samdevz**: They did a lot of cool stuff for us… you get to go to all the events—you’re like a regular attendee—you get to watch the Key Note, and you also get to meet with people who have similar interests, or executives who are doing the kinds of things we’re doing, but at a higher level. I also had the opportunity to meet with this executive named Lisa Jackson. She kind of manages the environmental concerns at Apple and the social concerns—that kind of ties in with what I’m doing. I make a lot of volunteering-oriented apps, that are designed to help people. That was really cool. **@katyadee**: Did you have a favorite part? **@samdevz**: Oh my god…So much. So, I had a friend there. I make apps and he makes games. We got the chance to meet with Apple’s marketing team, and I thought that was really valuable. They actually sat down with us one on one, and gave us suggestions on how to improve our presence on the App Store, how to market better, all sorts of different tips…like on how to monetize, for example. In general, it was so cool to meet the people who run the App Store. **@katyadee**: What was some of the best advice that they gave you? **@samdevz**: You always want to have an engaging page on the App Store. Screenshots on your app are important, but so are preview videos. Those keep people engaged. Also make sure your reviews are good, and respond to the reviews you do get. They also talked about monetization and different ways to make money… One of the best ways to make money is really ads. Not a lot of people will spend money in-app if your app is new. So, they walked us through how to get started with ads and that was really helpful, too. **@katyadee**: Wow—that’s really dedicated. I’m surprised to hear how available they were to help people. So, we’ve talked a bit how you’re an app developer… could you tell me a bit more about your background with that? **@samdevz**: The main app I’ve developed is called [Questlin](https://www.questlin.com) and it’s an app to help people find places to volunteer near by. That project is really important to me, because my school, we’re required to do service every year. And every year, I’d been kind of doing the physical side of volunteering… but at one point, I was speaking to this executive at this non-profit I go to a lot, and I was asking him about different ways to volunteer. ![Screen Shot 2019-06-14 at 6.47.16 PM](https://storage.googleapis.com/replit/images/1560884345439_fa6fae9e6763a2ad1d28728e5027f02f.png) And then he was like, here’s what we can use actually: an app that can help us keep track of volunteers and volunteering. I started working on Questlin from there. It’s been really cool and it’s gotten some attention. Recently, I even got to meet [Congresswoman Bonnie Watson Coleman](https://watsoncoleman.house.gov). **@katyadee**: Whoa. That’s really amazing. I’d love to hear more about how that happened. **@samdevz**: Well, we entered this thing—it’s actually really great for students and I encourage everyone to enter. It’s called the [Congressional App Challenge](https://www.congressionalappchallenge.us). Basically, you create an app within your district, and then your representative reviews your app. You get to go to Congress, and meet congresspeople… A lot of them will even download your app. That was a really valuable experience, and I’m really glad I did that. We’re getting more and more downloads. There’s a place in New Jersey using it… **@katyadee**: Let’s back up a second… Is Questlin for keeping track of volunteers, or is it more consumer-facing? **@samdevz**: It’s actually both! There’s a portal for non-profits and for volunteers. The biggest challenge has been expanding. The way I designed it, it’ll only show places nearby, so for a lot of people it’s not really that useful right now, it’s more useful in certain places than others. That’s been a big obstacle. **@katyadee**: Could I download it here in Austin and use it, or have you only rolled out to certain markets? **@samdevz**: Unfortunately, right now we have to manually add non-profits. We’re trying to make it more automatic, though. We’re working on a better version of it. When I won the challenge, it became a featured app in the App Store and it got a lot more downloads, and we got a lot of complaints that users couldn’t use it where they are. But some non-profits have reached out to us, so we’re working on fixing these things now. **@katyadee**: Those are pretty exciting obstacles to have, though! **@samdevz**: There was so much more interest than I expected, it really just started off as this small thing at my school. I never anticipated people from different places would use it, or an audience this large. Now we’re working to catch up with the demand now. **@katyadee**: You know, it sort of reminds me of… I can’t actually remember the name of it. There’s like a website I would use—I mean, this had to be 10 years ago, now—to find volunteer opportunities… I wish I remembered the name, it would make my point more salient. But I guess my question was going to be how you were different from other, existing and similar products. Maybe my inability to remember them says it all, though. **@samdevz**: *(laughing)* VolunteerMatch, Mobile Serve? **@katyadee**: You know what—yeah, I do think it was VolunteerMatch. How would you say you’re different from them? **@samdevz**: Well, we’re an app. We want to integrate VolunteerMatch’s API. **@katyadee**: That’s awesome that you guys are working together. **@samdevz**: It’s a nice space to work in because everyone wants to work together, instead of against one another.
0
posted by katyadee (676) 9 days ago
Pinned
14
😎App of the Week😎: Kognise's FontKey
This week's App of the Week is simple—press your space bar, and get a served a new font. The idea is to broaden your horizons... beyond Montserrat, beyond Roboto, beyond Lato. Sometimes the simplest apps are the best. ![media](https://storage.googleapis.com/replit/images/1560790068140_e37f65748bcd26a813d929440313c155.pn) Check it out [here](https://www.fontkey.design). Shout out to @Kognise for the great work!
2
posted by katyadee (676) 10 days ago
Pinned
🚨NOT A DRILL🚨: WIN $5,000! We're having another competition!
### Friends, foes, loyal Replers, Boy do I have some news for y'all! On July 1st, we're kicking off another competition and the stakes are higher than ever. ![richrichrich](https://storage.googleapis.com/replit/images/1561408399112_514da1dfbb25d3bc66b26fb7e7430790.gif) **Types of programs accepted:** *Any.* Theme TBD. **Rules:** As always, *must* be original content & MUST be created *and* hosted on Repl.it **Prizes:** $5,000, $2,500, and $1,000 **Dates:** July 1 @ 00:00 PST to July 21 @ 00:00 PST Keep your 👀on [this page](https://repl.it/jam) for more info & our theme announcement! I am so pumped about this! This is our biggest one yet!
51
posted by katyadee (676) 2 days ago
9
SPACE challenge results!
It was so much fun seeing all your submissions for the space contest! All entries were put up on a pretty huge screen at repl.it's HQ - and it was really cool looking at your creations changing and being new every time we looked at them. As you might've seen on twitter - @kognise's https://www.fontkey.design won! It's something that met the challnges' requirements, was fun to play with - and on top of that super useful too! I used it a couple of times to decide fonts for my projects already✨ Some other submissions I really liked: - @eankeen's [XKCD Viewer](https://repl.it/talk/challenge/XKCD-Comic-Viewer/15574) - @fmahaztra's [Exoplanet Generator](https://repl.it/talk/challenge/Get-real-exoplanet-data-from-NASA-every-time-you-press-space/15496) - @RileyWalz's [Excursion](https://repl.it/talk/challenge/Excursion/15721) - @ArchieMaclean's [Cellular Automata](https://repl.it/talk/challenge/Cellular-Automata/15611) - @pyelias's [Cool Fractals](https://repl.it/talk/challenge/some-cool-fractals/15499) I'm looking forward to see y'all submit even more entries to our next, *huge* contest 👀
5
posted by jajoosam (535) 2 days ago
See more posts
Ask
Ask coding questions
Pinned
68
Guide to Asking Coding Questions
# **Guide to Asking Coding Questions** ## **Why?** Good questions help your question be solved faster, and people will want to answer your question Bad questions waste time, you will often not get answers that you asked for, and people will often ignore your questions ## **Quick Questions Guide** ### Do This - Always ask your questions in English - Explain what you want the code to do - Explain what the code does - Include error messages - Share the repl with the line numbers - When you figure out the answer, update your post - Put the repl link, instead of pasting code ### Don't Do This - Don't post homework questions - Don't use caps in the title - Don't use words like 'HELP' or 'PLEASE' in the title - Don't post questions that already have an answer (Search Box) - Don't post feedback or bugs on Talk, use [repl.it/feedback](https://repl.it/feedback) for feedback, or [repl.it/bugs](https://repl.it/bugs) for bugs ## **Steps For Better Questions** 1. Understand the code - Read your code and figure out what each line does - If a concept is unfamiliar, Google it - You can also use a debugger to help you 2. Describe the problem - Explain what you want the code to do - Explain what the code does (error messages) 3. Provide the code - Share a repl that has your code - Share the line number(s) of your code issue - Make sure that the code you shared has the issue 4. Format code consistently - Make sure your code is easy to read 5. Check for typos - Make sure the code does not have any typos that would cause the problem 6. Explain what you did to troubleshoot the problem - Make a list of what you think the problem is and try to fix your problem by going through the list 7. Make a guess on what you think the problem might be - Use the list from the previous step 8. Proofread the question - Make sure you provided everything - Clear all confusions that you think there might be 9. Update people on the question - If you figured out the answer, edit the post to tell people - When you get an answer, fully understand it - Be nice to people who answer your question - Remember that the people wanted to answer your question, but didn't have to 10. Things to NOT do - Don't post homework questions - Only post questions in English - Do not use caps in the title - Do not use "HELP" or "PLEASE" in the title - Don't post questions that have already been answered (Use search box) - Don't post feedback or bugs on Talk, use [repl.it/feedback](https://repl.it/feedback) for feedback, or [repl.it/bugs](https://repl.it/bugs) for bugs ## **Example:** ### **Question** We have some Python code with an error: [repl](https://repl.it/@Mosrod/Question-Tutorial) ```python rannumexe = int(input()) if rannumexe = 1: print('hi' + rannumexe) ``` ### Step 1 We show what each line does using comments. ```python rannumexe = int(input()) # Asks the user to input a rannumexe if rannumexe = 1: # If the rannumexe equals 1 print('hi' + rannumexe) # Print hi and the rannumexe ``` ### Step 2 We want the code to input a number, and if the number is one, print "hi" and the number. Our problem is that we have an invalid syntax error on line 2 in the main.py file. ``` File "main.py", line 2 if rannumexe = 1: ^ SyntaxError: invalid syntax ``` ### Step 3 Our repl with the issue is located [here](https://repl.it/@Mosrod/Question-Tutorial). We have an issue on line 2 ### Step 4 We can change "rannumexe" to "number" to clear confusion ```python number = int(input()) # Asks the user to input a number if number = 1: # If the number equals 1 print('hi' + number) # Print hi and the number ``` ### Step 5 We don't have any typos ### Step 6 Our problem could be that we improperly used the if statement ### Step 7 The problem could be about using the if statement incorrectly ### Step 8 Our final question: Title: Invalid syntax error about equal signs Content: I have an invalid syntax error on line 2 in the main.py file of this [repl](https://repl.it/@Mosrod/Question-Tutorial). The program should take a number as an input, check if the number is equal to one, and if so, print "hi" and the number. The error point to the equal signs and I think this issue is with the incorrect syntax of the if statement. Help is appreciated :). ```python number = int(input()) # Asks the user to input a number if number = 1: # If the number equals 1 print('hi' + number) # Print hi and the number ``` ``` File "main.py", line 2 if rannumexe = 1: ^ SyntaxError: invalid syntax ``` Steps based on Gordon Zhu's [post](https://medium.com/@gordon_zhu/how-to-be-great-at-asking-questions-e37be04d0603). If you have any suggestions or feedback, post it in the comments below.
31
posted by Mosrod (249) 9 months ago
Pinned
4
⛈Brainstorm ⛈What should we code?
The last time I had one of these threads, we got a lot of cool answers. So... let's kick this off again! What should we code? What should I, Katya, code?
23
posted by katyadee (676) 2 days ago
3
What's your most impressive repl?
What's the coolest repl you've ever created? For me, easy - it's any of the newsletters.
15
posted by katyadee (676) 1 day ago
answered
7
Daily Question #7: What is your most important possession?
Nobody posted on my Daily Question yesterday, however, i am hoping to change that with today's question! What is your most important Possesion? Mine is my books. I don't really take anything to heart, apart from books. Books let me travel to a different world when things get harsh in my own eyes. Meme of the day: ![image](https://storage.googleapis.com/replit/images/1561466647643_ffc143a87130dfd13a37ad51d362eacd.png)
7
posted by ReshiramWolfu (50) 2 days ago
11
What line of code describes you best? 🤔
Okay, I lifted this from Quora, but I thought it was a really cool question with lots of ways to interpret it! What line of code describes y'all best?
26
posted by katyadee (676) 8 days ago
See more posts
Learn
Learn to Code via Tutorials on Repl.it
26
🌚🕶 How to Enable Repl.it Site-Wide Dark Theme 🕶🌚
# Repl.it Site-Wide Dark Theme Do you like not being blinded while browsing Repl.it? Well me neither! ![Repl talk on dark theme](https://storage.googleapis.com/replit/images/1557091294976_160fda0e32057fb2f3a93d971d4a4203.pn) *** First, you might not have the editor dark theme enabled, so make sure you enable that. 1. Click the settings button at the left of the editor screen. ![Settings Button](https://storage.googleapis.com/replit/images/1557091461609_7a585f76190494f3bc741389062781a0.pn) 2. Find the theme dropdown, and select *dark* ![theme dark](https://storage.googleapis.com/replit/images/1557091792258_8f89ba2a4630090419013d3220ddbd0d.pn) *** Now that you have the editor dark theme enabled, we will enable the site-wide dark theme. 1. Download Tampermonkey for [Chrome](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/) 2. Choose a theme from [the list of themes](https://www.darktheme.tk/themes) or [create your own](https://www.darktheme.tk/custom) 3. Click the `install` button. 4. Upvote and post a comment on this tutorial. 5. Profit!
20
posted by mat1 (2205) 2 months ago
64
🚀 A Starter Guide to Pygame 📀
# 🚀 A Starter Guide to Pygame 📀 Pygame is an open-source library for making graphical applications with Python. Learn more about it on the official [website](https://pygame.org). This tutorial is intended to help you setup a very basic Pygame interface. It's for Python beginners or people who want to quickly bootstrap a Pygame project. Find more about Repl.it's GFX public beta announcement [here](https://repl.it/talk/announcements/Replit-GFX-Public-Beta-Build-Games-and-GUI-Apps/11545). So let's get started! We're going to be building a simple screen saver. The final result will look like the following ![programProgress4](https://i.imgur.com/dEileMP.gif) ## Starting out When creating a new project, be sure to select "PyGame" when creating a project. ![image](https://storage.googleapis.com/replit/images/1552705106070_4aa0e807cd3fb5197a7251222d74d724.pn) Now we're ready to start writing some code! ## Painting the Screen Red 🎨 First, we're importing Pygame and initializing all the imported pygame modules with [`pygame.init()`](https://www.pygame.org/docs/ref/pygame.html#pygame.init). Second, we're declaring `width` and `height` variables that represent the size of the screen. Third, we're setting `backgroundColor` to a tuple of 3 elements that represent the RGB numbers. Fourth, `screen` is a display Surface, or an initialized window or screen for display with the [`set_mode()`](https://www.pygame.org/docs/ref/display.html#pygame.display.set_mode) method. Lastly, in the infinite loop, we're filling the screen to the `backGroundColor` and updatiang the display Surface to the screen. In other words [`pygame.display.flip()`](https://www.pygame.org/docs/ref/display.html#pygame.display.flip) "refreshes" the screen with changes you made to the grahpics. ```python import pygame pygame.init() width, height = 800, 600 backgroundColor = 255, 0, 0 screen = pygame.display.set_mode((width, height)) while True: screen.fill(backgroundColor) pygame.display.flip() ``` So, we get a red background! ![programProgress1](https://storage.googleapis.com/replit/images/1552448696584_73e029d5335f2d2a06c92a180e7103be.pn) ## Adding the DVD Right before you while loop, import an image of your DVD. Feel free to use the same image I used, in the repl below. ```python dvdLogo = pygame.image.load("dvd-logo-white.png") ``` Then, create a rectangle from the Surface, or from the image you just loaded with [`get_rect()`](https://www.pygame.org/docs/ref/surface.html?highlight=get_rect#pygame.Surface.get_rect) ```python dvdLogoRect = dvdLogo.get_rect() ``` Now, inside of the `while` loop (after filling the background color), "map" the imported image to the `dvdLogoRect` rectangle using the [`blit()`](https://www.pygame.org/docs/ref/surface.html?highlight=blit#pygame.Surface.blit) method. That way, the image stays inside of the invisible `dvdLogoRect` rectangle. ```python screen.blit(dvdLogo, dvdLogoRect) ``` Now, we get a DVD! ![programProgress2](https://storage.googleapis.com/replit/images/1552449702561_27872d2c7a30d4d9dbb53d3c908851d9.pn) ## Moving the DVD Logo To move the DVD logo, simply use `move()` by a speed: ```python dvdLogoRect = dvdLogoRect.move(dvdLogoSpeed) ``` Make sure you also declare and initialie dvdLogoSpeed at the top of the file. `dvdLogoSpeed[0]` represents the speed in the `x` direction. ```python dvdLogoSpeed = [1, 1] ``` Finally, I added a `time.sleep(10 / 1000)` so the logo moves slower. So my code ended up looking like ![programProgress3](https://i.imgur.com/dsh8TYo.gif) The DVD logo *will* move off the screen because there is no bouncing. To implement a check for bouncing, add the following: ```python if dvdLogoRect.left < 0 or dvdLogoRect.right > width: dvdLogoSpeed[0] = -dvdLogoSpeed[0] if dvdLogoRect.top < 0 or dvdLogoRect.bottom > height: dvdLogoSpeed[1] = -dvdLogoSpeed[1] ``` The `.left` and `.right` properties don't seem to be [documented](https://www.pygame.org/docs/ref/rect.html?highlight=rect%20left), but it's implied that `.left` measures the distance from the left part of the `dvdLogoRect` Rect (rectangle) to the left part of the `screen.` And so on and so fourth for `.right`, `.top`, and `.bottom`. Here is the final result ![programProgress4](https://i.imgur.com/dEileMP.gif) Now let me know when the logo hits the corner!
31
posted by eankeen (501) 4 months ago
35
How I solved the Secret Announcement
# A Detailed Solution to Secret Announcement ### Background: You are most likely busy creating a game for the game jam and you probably know that an announcement came 2 weeks before the jam as a secret message using [steganography](https://en.wikipedia.org/wiki/Steganography) I was one of those chaps who actually solved the secret, but didn't do anything. The challenge can be found [here](https://repl.it/@timmy_i_chen/secret-announcement?ref=newsletter). There was a solution, but that was not very explanatory.This post will explain how ~I~ solved the announcement. This post assumes basic knowledge of the binary system. *** The first thing I did after seeing the newsletter was to read up on steganography.I found this on wikipedia: >Concealing messages within the lowest bits of noisy images or sound files Interesting... ## Reverse Engineering: Then, I looked at the code.Apart from imports and loops to go through all pixels,this was the crux of the code: ```py secret_red = secret_pix[0] >> shift_amt secret_green = secret_pix[1] >> shift_amt secret_blue = secret_pix[2] >> shift_amt public_red = public_pix[0] & all_except_LSB_mask public_green = public_pix[1] & all_except_LSB_mask public_blue = public_pix[2] & all_except_LSB_mask final = ( secret_red + public_red, secret_green + public_green, secret_blue + public_blue ) ``` `>>` and `&` are [binary operators](https://en.wikipedia.org/wiki/Bitwise_operation).shift_amt was 7 and all_except_LSB_mask was 254 What does the >> operator do? It shifts the bits towards towards right.For example: `11100010101 >> 6` outputs `11100` i.e. the last 6 bits are removed. In our case, all the 8 bit data(because 255 is the maximum in RGB color format and 255 is 8 bits) is shifted by 7 bits so that would leave only the highest bit as one or zero. This would also imply that anything greater than 127.5 (255 / 2) would leave 1 while anything lesser would leave zero. `10101010 >> 7 == 1` `01010000 >> 7 == 0` So that's our secret pixel Then, we see the `&` operator with all_except_LSB_mask as 254.The & operator is called bitwise and. Basically, it returns one only if both expressions are one.Like `1&1 == 1` `1&0 == 0` `0&0 == 0` An important property of the & operator is that `something & all 1s = something` another one is that `something & 0 = 0` `10100100`&`11111111`==`10100100` 254 in binary is `11111110` So,all the bits except the last one would remain intact `10011011 & 11111110 ==10011010` So,this would turn all public pixels into even numbers as the last bit is 2**0=1 and if it is absent, the number must be even. The final pixel is secret_pix + public_pix.We know that public pix is either 0 or 1.Since the last bit of public pix is always zero,The last bit of final pixel must reflect the secret image. So here's my code: ```py from PIL import Image public=Image.open('out.png').convert('RGB') secret=Image.new('RGB',(600,600)) for x in range(600): for y in range(600): secret.putpixel((x,y),tuple((i%2)*255 for i in public.getpixel((x,y)))) secret.save('secret.png') ``` All the juicy stuff is in one line:`(i%2)*255 for i in public.getpixel((x,y)` What this does is: + take the public pixel + compute modulo two (returns 1 if odd and 0 if even) + multiply that by 255 because 00000001 or 00000000 show no visible difference but 11111111 and 00000000 do + put this in the secret image, pixel by pixel And Heres my output: ![secret](https://storage.googleapis.com/replit/images/1553919764220_1470a455120ad93feec70c9423124f04.pn) waow indeed
12
posted by Lord_Poseidon (108) 3 months ago
11
BOOKMARKLETS!
# What is a bookmarklet? A bookmarklet is similar to an extension, but is used by clicking a bookmark. According to wikipedia: > A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser. Bookmarklets are unobtrusive JavaScripts stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. Bookmarklets are usually JavaScript programs. Regardless of whether bookmarklet utilities are stored as bookmarks or hyperlinks, they add one-click functions to a browser or web page. When clicked, a bookmarklet performs one of a wide variety of operations, such as running a search query or extracting data from a table. For example, clicking on a bookmarklet after selecting text on a webpage could run an Internet search on the selected text and display a search engine results page. # Create a bookmarklet Creating a bookmarklet is easy. (If you do know how to create a bookmark. If not read [Creating A Bookmark](https://www.computerhope.com/issues/ch000858.htm) ) Let's create a simple example: First, create a bookmark. As for the title of the bookmark, name it “Hello World”. Instead of keeping the url of the page as the bookmark type `javascript:alert(‘Hello World!’)`. There! Click save or whatever it is in your search engine. And click the bookmark. You should have an alert message saying “Hello World!” appear! To run js in a bookmark, you need to have the `javascript:` prefix before it. You can only type one line so make sure to use your semicolons! In addition, you **can not use double quotes**. The search engine saves the bookmark in code that looks something like this: ```html <a href="javascript:alert(‘Hello World!’)">Hello World</a> ``` If you use double quotes it looks like: ```html <a href="javascript:alert(“Hello World!”)”>Hello World</a> ``` And causes an error. If you have multiple lines, create an anonymous function: `javascript:(function(){ var x=prompt(‘Hi say something:’); alert(‘You said: ’ + x); })()` Notice there are NO double quotes. Let's go over some examples: Google Search: `javascript:(function(){window.open('https://www.google.com/search?q='+prompt('Google Search:', '').split(' ').join('+'), '', 'width=800,height=500,left=10,top=10,scrollbar=yes');})();` The above example opens up a new window with a search query of your input! Feel free to copy any of these or the ones listed below. Calculator: `javascript:(function(){var evl,expr=prompt('Formula...','');with(Math)try{evl=parseFloat(eval(expr));if(isNaN(evl)){throw Error('Not a number!');}prompt('Result of '+expr+':',evl)}catch(evl){alert(evl);}})();` @JSer ‘s Rolling Sky: (Thanks for creating such an awesome game!) `javascript:window.open('https://Rolling-Sky--jser.repl.co', '', 'top=15,left=15,scrollbar=yes,width=500,height=600')` # Community Creations @Zavexeon **Faces Generator** > uhm... it works.... and is also useless... ```js javascript: const faces = ['OwO ', 'UwU', 'TwT', '>w<', '^w^']; let face = faces[Math.floor(Math.random()*faces.length)]; document.write('<body style=\'background-color: black;\'></body><title>' + face + '</title><p style=\'text-align: center; font-size: 500px; font-family: Arial; color: white;\'>' + face + '</p>'); ``` ** Thank you for reading! Please upvote and comment your own bookmarklets, to be added to the community creations section! I hope I get a content creator tag for this 😀 **
27
posted by PYer (2043) 2 months ago
21
LLC - Java
# Language learning club - Java ### Introduction Thanks to the [repl.it](https://repl.it) team (especially @amasad and @katyadee), we now have a language learning club about which you can learn more [here](<https://repl.it/talk/announcements/UPDATE-AS-OF-41519-Language-Learning-Club/12870>). We recently had a voice session for [GoLang](https://repl.it/languages/go) and it was pretty dull and I didn't want that to happen again. So I decided to contribute to the people learning Java myself. There is going to be a session over voice chat on the repl.it discord server at 06:00 PM CST on Mondays. You can join the discord server by [clicking here](https://repl.it/discord). ------ ### For Beginners Now that all the info has been shared, here are some resources you can use to get started with Java: - For book lovers: - - [Java: A Beginner's Guide](https://books.google.co.in/books/about/Java_A_Beginner_s_Guide_Sixth_Edition_IN.html?id=MaUiAwAAQBAJ&source=kp_book_description&redir_esc=y) - [Effective Java](https://books.google.co.in/books/about/Effective_Java.html?id=BIpDDwAAQBAJ&source=kp_book_description&redir_esc=y) For YouTube video lovers: - - [Java tutorial for beginners video series](https://www.youtube.com/watch?v=r59xYe3Vyks&list=PLS1QulWo1RIbfTjQvTdj8Y6yyq4R7g-Al) - [Another Java tutorial for beginners (9 hour video)](https://www.youtube.com/watch?v=grEKMHGYyns) ------ ### GUI Development with Java For people who have learned the basics of Java, here are a few YouTube videos that you can watch to learn GUI development with Java. For people who like to read: - - [Java Swing Tutorial](https://www.javatpoint.com/java-swing) - [Swing Tutorialspoint](https://www.tutorialspoint.com/swing) For people who like videos: - - [Complete Java Swing tutorial](https://www.youtube.com/watch?v=WRwPVZ4jmNY) - [Java Swing tutorial video series](https://www.youtube.com/watch?v=jUEOWVjnIR8&list=RDQMm8C0LW_jS50&start_radio=1) ------ ### Android App development For people who even know about Swing. Java is the most used language for mobile apps development in [Android Studio](https://developer.android.com/studio). [Click here to learn about Android App development](https://developer.android.com/studio/intro). Here you'll find that there is a new alternative to Java - `Kotlin`. And it also seems like a sweet choice. You can compare the differences between Java and Kotlin [here](https://hackr.io/blog/kotlin-vs-java). ------ ### Some code examples ***Note:*** *In all the examples the file was named as `Main.java` which is the default in [repl.it](https://repl.it). Also, the following examples use the simplest ways possible, these programs could've been made much smaller (except for the first one).* **Hello World** ```java /* This program is basically the boilerplate for the language*/ class Main { public static void main(String[] args) { System.out.println("Hello world!"); } } ``` ------ **Hello <name>** ```java // Importing the scanner class for taking input import java.util.Scanner; class Main { public static void main(String[] args) { // Declaring the variables String name; Scanner in = new Scanner(System.in); // Getting the name System.out.println("What's your name?"); name = in.nextLine(); // Printing the name System.out.println("\nHello, " + name); } } ``` ------ **Factorial** ```java // Importing the Scanner class for taking input import java.util.Scanner; class Main { public static void main(String[] args) { // Declaring the variables int n, factorial = 1; Scanner in = new Scanner(System.in); // Getting a number from the user. System.out.print("Please enter a number: "); n = in.nextInt(); // Calculating the factorial using a simple for loop for(int i = 1; i <= n; i++) { factorial = factorial * i; } // Showing the calculated factorial System.out.println("\nThe factorial of " + n + " is " + factorial); } } ``` ------ That's all for now. Visit the above links and learn more for yourself! :P
4
posted by TheDrone7 (499) 2 months ago
See more posts
Share
Share your repls and programming experiences
Pinned
Rules for Posting - Read me!
Some rules and guidelines to keep in mind as you share your great work on our boards: 1 - Be kind and courteous to others 2 - Make sure that any feedback you provide is constructive. 3 - Outside links are allowed, but you must provide the source. Ideally, things that you post will have been created on Repl.it. 4 - Avoid posting overly promotional material - the focus is, and always will be, a programming, learning, and collaborative community. :) 5 - Don't spam! Keep things SFW (Safe For Work). We may revoke your access to these boards if you are found to be in violation of any of these rules. Feel free to ask clarifying questions. Last updated 7/10/18 12:09 PST
63
posted by timmy_i_chen (925) 12 months ago
4
Click this post to get logged out of Repl.it!
# :) ![Logout](https://repl.it/logout) How it works: It's literally just an img tag that links to https://repl.it/logout
0
posted by mat1 (2205) 7 hours ago
27
👀 Domain Hack Finder 👀
# Domain Hack Finder Ever want to make a website, but you haven't been sure what you should name it? According to Wikipedia, a domain hack is a domain name that suggests a word, phrase, or name when concatenating two or more adjacent levels of that domain. For example, "bir.ds" and "examp.le", using the fictitious country-code domains .ds and .le, suggest the words birds and example respectively. In this context, the word hack denotes a clever trick (as in programming), not an exploit or break-in (as in security). Learn more about [domain hacks on my blog](https://www.matdoes.dev/blog/post/what-are-domain-hacks) ![Domain Hack Finder](https://storage.googleapis.com/replit/images/1560713948448_70de33f52af24ebcae9e109e2fd5828f.pn) [Try it out now! 😎](https://domain-hack-finder.mat1.repl.run) (Upvote this post for free Robux or MineCoins or whatever!)
40
posted by mat1 (2205) 11 days ago
2
brayden liakimatagi
code 100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101100101001010101010101001001010101010101010101010101010101010101010101010101011101101010101010101010110101010101011010101 there you go, people, of earth.
1
posted by BraydenPabst (1) 6 hours ago
19
FontKey
Hi! I've spent the past few days working on my submission, FontKey. I aimed to create something that both satisfies the requirements and is a useful tool people might use day-to-day. **Let's get to the meat.** What does it do? Simple, FontKey helps you find new fonts. If you've heard of Roboto, Open Sans, Lato, and Montserrat, you'll know that these fonts are at the top. And the sad thing is, most websites keep using them. When you press space, FontKey will pick a new font for you. You can try out font pairs and if you like one side of a pair you can lock it in place. But it does much more than that! You can **preview your fonts in realistic layouts,** and if you want to collaborate with someone else just **click a button to get a sharing link.** For example, [here's one](https://s.fontkey.design/KCgQ1wZaC1)! You can also **get code for your site** in a click. What else? Well, I made a cheesy promo video. You know - bouncy background music, lots of editing. Click [here](https://vimeo.com/342162889) or watch it on the site. Finally, there's auto mode. It'll automatically switch fonts in a fullscreen page every 5 seconds. It's there because it looks cool - and would make a nice screensaver. ## Closing First and foremost, [here's a link to FontKey](https://www.fontkey.design/). It's probably at the bottom too. I'd appreciate any feedback! I'm thinking I might eventually launch this on Product Hunt as well. ![FontKey: A modern way of finding fonts.](https://www.fontkey.design/static/media.png)
20
posted by Kognise (199) 13 days ago
See more posts