Will tutor/answer any questions for free.

Posts

Either post them below, pm me, or add me on Skype.

c.o.g.n.i.t.i.v.e

I won't give help on anything I find to be boring, unless it's a remedial task. tl;dr is I'll only help you if it's interesting or if you're in the progress of learning.

go.

Mavis wrote

Hex you suck more than a yoko.

I'll suck your dad off you faggot degenerate.

how do I make an img hosting website ;/
idk how that would be coded ;/

Bernkastel wrote

Why do you advertise this thread in a RPG section

Because the fact that Discord throws highlights current channels is the same way they highlight unread channels, which is fucking autistic. 

Yoko wrote

how do I make an img hosting website ;/
idk how that would be coded ;/

Not sure if you're joking or not. Not that it's a stupid question, but the emojis make me uncertain. 

Here
http://Hexpresso.net - made it when I got really bored and wanted a place for me to throw shit up.

The base concept of an image host is fairly easy.

  • Take files with image extensions

  • Save them all to a directory with random names(if you so choose)

  • Output uploaded image urls to users when finished

  • Serve said images when url is requested

That's conveyed fairly simply in the following code using Python's Flask.

from flask import Flask, render_template, request, send_from_directory

#Configuring Flask to run properly with root privs, and setting static dir
#to serve static files(uploads)
app = Flask(__name__, static_url_path='/static')

#Allowed extensions. 
ALLOWED_FILES = [
    'jpg', 'png', 'gif',
    'c', 'cpp', 'jpeg',
    'txt', 'java', 'pdf'
]

@app.route('/', methods=['GET', 'POST'])
def index():
    return render_template('index.html')

@app.route('/upload', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f_ext = f.filename.split('.')[1]
        if f_ext in ALLOWED_FILES:
            f.save('static/uploads/' + f.filename)
            return render_template('index.html', file_name=f.filename)
        else:
            return render_template('index.html', rude_dood=True)
            
#So idiots can actually be served files.
@app.route('/<filename>', methods=['GET'])
def serve_static(filename):
    print(filename)
    return send_from_directory('static/uploads/', filename)

if __name__ == '__main__':
    app.debug = True
    app.run()
Hex wrote
Bernkastel wrote

Why do you advertise this thread in a RPG section

Because the fact that Discord throws highlights current channels is the same way they highlight unread channels, which is fucking autistic. 

Yoko wrote

how do I make an img hosting website ;/
idk how that would be coded ;/

Not sure if you're joking or not. Not that it's a stupid question, but the emojis make me uncertain. 

Here
http://Hexpresso.net - made it when I got really bored and wanted a place for me to throw shit up.

The base concept of an image host is fairly easy.

  • Take files with image extensions

  • Save them all to a directory with random names(if you so choose)

  • Output uploaded image urls to users when finished

  • Serve said images when url is requested

That's conveyed fairly simply in the following code using Python's Flask.

from flask import Flask, render_template, request, send_from_directory

#Configuring Flask to run properly with root privs, and setting static dir
#to serve static files(uploads)
app = Flask(__name__, static_url_path='/static')

#Allowed extensions. 
ALLOWED_FILES = [
    'jpg', 'png', 'gif',
    'c', 'cpp', 'jpeg',
    'txt', 'java', 'pdf'
]

@app.route('/', methods=['GET', 'POST'])
def index():
    return render_template('index.html')

@app.route('/upload', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f_ext = f.filename.split('.')[1]
        if f_ext in ALLOWED_FILES:
            f.save('static/uploads/' + f.filename)
            return render_template('index.html', file_name=f.filename)
        else:
            return render_template('index.html', rude_dood=True)
            
#So idiots can actually be serveed files.
@app.route('/<filename>', methods=['GET'])
def serve_static(filename):
    print(filename)
    return send_from_directory('static/uploads/', filename)

if __name__ == '__main__':
    app.debug = True
    app.run()

Thank you, your concepts made it easier to understand the process!
I don't know Python at all though, I do know Javascript a bit though so maybe I could make it work with that?
Do you know JS?
If I could just set up a simple site like yours that would be really cool, but idk if I want to use Python.

Yoko wrote
Hex wrote

Because the fact that Discord throws highlights current channels is the same way they highlight unread channels, which is fucking autistic. 

Not sure if you're joking or not. Not that it's a stupid question, but the emojis make me uncertain. 

Here
http://Hexpresso.net - made it when I got really bored and wanted a place for me to throw shit up.

The base concept of an image host is fairly easy.

  • Take files with image extensions

  • Save them all to a directory with random names(if you so choose)

  • Output uploaded image urls to users when finished

  • Serve said images when url is requested

That's conveyed fairly simply in the following code using Python's Flask.

from flask import Flask, render_template, request, send_from_directory

#Configuring Flask to run properly with root privs, and setting static dir
#to serve static files(uploads)
app = Flask(__name__, static_url_path='/static')

#Allowed extensions. 
ALLOWED_FILES = [
    'jpg', 'png', 'gif',
    'c', 'cpp', 'jpeg',
    'txt', 'java', 'pdf'
]

@app.route('/', methods=['GET', 'POST'])
def index():
    return render_template('index.html')

@app.route('/upload', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f_ext = f.filename.split('.')[1]
        if f_ext in ALLOWED_FILES:
            f.save('static/uploads/' + f.filename)
            return render_template('index.html', file_name=f.filename)
        else:
            return render_template('index.html', rude_dood=True)
            
#So idiots can actually be serveed files.
@app.route('/<filename>', methods=['GET'])
def serve_static(filename):
    print(filename)
    return send_from_directory('static/uploads/', filename)

if __name__ == '__main__':
    app.debug = True
    app.run()

Thank you, your concepts made it easier to understand the process!
I don't know Python at all though, I do know Javascript a bit though so maybe I could make it work with that?
Do you know JS?
If I could just set up a simple site like yours that would be really cool, but idk if I want to use Python.

Haven't done it in js before, but I'm pretty sure you can just post the file to the directory within a form. I'll look into it.

Hex wrote
Yoko wrote

Thank you, your concepts made it easier to understand the process!
I don't know Python at all though, I do know Javascript a bit though so maybe I could make it work with that?
Do you know JS?
If I could just set up a simple site like yours that would be really cool, but idk if I want to use Python.

Haven't done it in js before, but I'm pretty sure you can just post the file to the directory within a form. I'll look into it.

True, I guess if I can just make the image file go to the directory and then call it back it will work
or something
wut

Yoko wrote
Hex wrote

Haven't done it in js before, but I'm pretty sure you can just post the file to the directory within a form. I'll look into it.

True, I guess if I can just make the image file go to the directory and then call it back it will work
or something
wut

Meh, not sure. Honestly the best thing to do would be setting up a route at like, /upload that takes post data and saves the file it receives. Which can't be done with vanilla JS, as far as I know, since that's server-side work. Node, however, would be fitting. I just prefer Flask over Node for various reasons.