Cliff Syner

@c4syner (71) • Googleplex
Just an aspiring engineer.
how to share repls?
posted to Ask by awesomearjun1

If you would like to share it with someone to work with you there is an +invite button which will give you a link to a multiplayer session. If you'd like to just generally share your code simply copy the url in your browser and share where needed.

The Monte Carlo method explained
posted to Tutorials by DynamicSquid

This is actually super interesting. Nice project!

👀 Domain Hack Finder 👀
posted to Share by mat1

@mat1 Confusion 100

Uptime Robot not working with Discord Cloudflare
posted to Ask by xCloudzx

Try using my modified version of keep_alive, it doesn't require an external pinger.

from flask import Flask
from threading import Thread
import random
import time
import requests
import logging
app = Flask('')
@app.route('/')
def home():
    return "You have found the home of a Python program!"

def run():
  app.run(host='0.0.0.0',port=random.randint(2000,9000)) 
def ping(target, debug):
    while(True):
        r = requests.get(target)
        if(debug == True):
            print("Status Code: " + str(r.status_code))
        time.sleep(random.randint(180,300)) #alternate ping time between 3 and 5 minutes
def awake(target, debug=False):  
    log = logging.getLogger('werkzeug')
    log.disabled = True
    app.logger.disabled = True  
    t = Thread(target=run)
    r = Thread(target=ping, args=(target,debug,))
    t.start()
    r.start()

Then usage would look like:

import neverSleep
neverSleep.awake(yourReplURL, False)
#All your code: \/
Not boring coding ideas.
posted to Ask by Rileymabb

I recommend some multiplayer project depending on your knowledge. They're super interesting to program and learn how to build. (websockets, clients, servers etc.) Not exactly a specific project but something cool to work on.

Why doesn't repl.it have a dark mode?
posted to Ask by CodingCactus

Haven't seen anything about what @mat1 did so here it is: https://darktheme.matdoes.dev/themes
super experimental and clanky, I know but it's pretty epic

Python Discord Bot Template
posted to Templates by c4syner

please upvote if this is even relatively interesting to you lol

Can I use django in repl.it
posted to Ask by Deepcuf

Yes! Template: https://repl.it/@templates/Django-Template

if this was helpful, please upvote

What do I program? Well...
posted to Share by HerculukeZeEpic

A Vibe checker

Changing a string from a specific line in text file
posted to Ask by ZestyLad
with open('abc.txt','w') as f:
    f.write("Members\t\tLoans"+"\nMark\t\t500"+"\nSteve\t\t1000"+'\nAnne\t750'+'\nAlpha\t520')

a=input("Enter name: ")
b=input("Enter new loan: ")
index = 0
with open('abc.txt','rt') as f:
    lines = f.readlines() #readlines is crucial here
    for i in range(len(lines)):#Find index of line where user is 
      if a in lines[i]:
        index = i 
    #now have index replace value
    mainStr = lines[index]
    originalStr = mainStr #preserve original value
    curNum = int(''.join(filter(str.isdigit, mainStr))) #find current loan
    mainStr = mainStr.replace(str(curNum), str(b)) #change value of loan
    for i in range(len(lines)): #replace value of original loan
      if originalStr in lines[i]:
        lines[i] = mainStr
    lines = "".join(lines) #make it into a big string like before
    print(lines)

with open('abc.txt','w') as f:
    f.write(lines)

This should work pretty good, supports the same file export that you had in your original code and can support more people being added.

please upvote if this helped

Will you die to Covid-19
posted to Share by Uzalii

73 %...RIP me. Also little code thing.
if you did fish = input("Do you eat a lot of fish: ").lower() for example you can remove all of the
if fish == "No" or fish == "no"
and make it
if fish == "no"
Just in case you didn't know.

Press Space for FREE 👏 MEMES 👏
posted to Share by liltaco

@mat1
Nobody:
Not a soul:
mat1: You should add a dark theme #maketheworlddarkagain

What do you do for keeping your concentration while coding?
posted to Ask by qualladoom

I just try to do projects that are interesting and that alone can be self sustaining for programming interest. If you are being forced to do a certain project, then whatever the purpose for doing it should be the drive, ie. A grade, peer-satisfaction, money (job) etc.

Announcing contest SPACE 🏆
posted to Share by jajoosam

oh I did'nt see that before thanks! @ryanhcode

Announcing contest SPACE 🏆
posted to Share by jajoosam

Do we have to do anything special when submitting the web app... or just post it to the share forum?

Epic Clickbait Title Generator
posted to Share by c4syner

@noah427 Thanks!!

Epic Clickbait Title Generator
posted to Share by c4syner

Hey if you guys enjoy, please be sure to upvote!
Thanks!

Repl Randomly Dies
posted to Ask by c4syner

@SixBeeps
Ya, unfortunately, I've got to scrape the data ticker by ticker which slows it down a ton. I'm currently giving it a shot on my workstation.

Repl Randomly Dies
posted to Ask by c4syner

@Coder100
If it does end up being a memory issue I'd be totally down to purchase the hacker plan, I use repl all the time. However, before I would do that is there anyway I can confirm if I am running out of memory?

Is it possible to empty the built in repl.it database of it's data?
posted to Ask by c4syner

@JosephSanthosh No problem. I just create a simple for loop to cycle through the entire database and delete all the keys and subsequent data.

Is it possible to empty the built in repl.it database of it's data?
posted to Ask by c4syner

@SixBeeps No, just a bit of a slowdown to my workflow. Problem averted though, just created a function to cycle and clear!

Adding new files with the new UI
posted to Ask by c4syner

@Coder100 can I use python turtle with that?

Adding new files with the new UI
posted to Ask by c4syner

@Coder100 oh okay, that's strange. Do you know why?

Uptime Robot not working with Discord Cloudflare
posted to Ask by xCloudzx

@xCloudzx That's just what I did, you could put this where keep_alive is. (removing keep_alive of course)

Adding new files with the new UI
posted to Ask by c4syner

@Coder100 I do... but disabling didn't change anything, I've posted a screenshot as a comment

Uptime Robot not working with Discord Cloudflare
posted to Ask by xCloudzx

@c4syner Oh and rename the top code to neverSleep.py. BTW I've had a discord bot staying alive for the past 2 months without issue with this!

Adding new files with the new UI
posted to Ask by c4syner

@Coder100 hmm for some reason when I open a python turtle project that doesnt exist lol. It just shows the Branch Icon, settings, and database.

NEVER have your Python Repls go to sleep again!
posted to Share by c4syner

@SixBeeps No no... If you were to use a different programming language other than python. It will work because it's really just a scheduled ping program. The thing to note here is that this is outside of node.

NEVER have your Python Repls go to sleep again!
posted to Share by c4syner

@SixBeeps you technically could put in ANY website (including a node.js repl) and have it keep online.