« first day (7 days earlier)      last day (627 days later) » 

00:17
can someone else approve this: github.com/Mego/PPCG-v2/pull/19
Anonymous
@Downgoat Ffs stop
If I have like:
a href="/user/logout?redirect={{ request.url }}">
is there a way to escape request.url so the user can't do like " onclick="evil js" as part of their URL
Anonymous
@Downgoat Append |e
TIL html escape work in attribute
Anonymous
00:33
Yep, you can pipe any string through e. It just does normal HTML escaping.
00:47
WIll we have rep?
Anonymous
In what manner?
just like points that people gain when an answer is upvoted etc.
Anonymous
Yes
Anonymous
Haven't decided on the scale, yet, though
oh ffs I just did a stupid
ok screw it I'll just merge the whole thing
Anonymous
00:56
You worry me when you say things like that
Anonymous
You should set up your IDE to auto-commit every 5 minutes or something
Is there a way to git stash data and then git stash pop it to multiple branches?
how would I use url_for for resources which don't have routes. do you mean like url_for('templates', filename='svg/user.html')
So like git stash && git checkout goat-backup && git stash pop && git checkout <working-branch> && git stash pop
@Pavel store a diff and apply the diff to multiple branches
git add -A && git diff @ > stash.diff && git checkout b1 && git apply stash.diff I think
or you might have to do git reset instead of git add -A not sure
01:01
well git reset will just nuke the changes you're backing up so that seems wrong.
no it unstages things
Anonymous
@Downgoat You could just add a route for the base dir and then pass the filename as a GET param
git reset reverts your working directory to the last commit
@Pavel you're thinking of git checkout/reset --hard
@Mego that would give a URL for like <a> tag, would it work for a flask compile-time {% include %}?
Anonymous
@Downgoat It should. Routes are loaded before templates are initialized.
01:09
url_for('/', filename='includes/header/authmanager.html')
that seems to give an error that there is no endpoint /
oic
oh wtf SE uses old open id protocol ;_;
It's like a decade old by now
ok well time to add oauth then I guess :|
oauth doesn't provided any identity though
do we know if SE uses v1 or v2?
Anonymous
@Downgoat It should be something like url_for('headers', filename='authmanager.html'), and then have @app.route('/headers/<filename>') def headers(filename): return whatever
Anonymous
@Downgoat v2. They have documentation here
why are you people so smart :()
01:18
@Christopher2EZ4RTZ Been doing this for a long time
@Christopher2EZ4RTZ you're saying this to the guy goat who just did sudo rm -r static/js
Experience unfortunatly does not bring with it carefulness.
@Downgoat WHY DO WE LET GOATS HAVE LINUX??
Would we store the refresh token in the DB?
that wouldn't work with logging in again though
would that mean we have to implement seperate oauth route for every. single. provider. we want to support?
Anonymous
@Christopher2EZ4RTZ If you don't have anything constructive to contribute, then don't.
01:20
Do you have anything simple that I can do? @Mego
Anonymous
Here is an example implementation of SE OAuth2's flow in Python @Downgoat
Anonymous
@Christopher2EZ4RTZ Look at the project board on GitHub. There's a few things left for basic API stuff.
@Christopher2EZ4RTZ yes, unittests
@Downgoat I have read many reddit memes about how hard unit tests are. Idk if they are true but I am going with mego
I'm currently taking an extra semester of math outside of regular school. I procrastinated on it and had to compress like two months of curiculum into the past week, but I'm getting it completely finished today so I'll be able to work more from now on.
@Christopher2EZ4RTZ They're really not hard, unless you're using Junit. Then it's a PITA.
Anonymous
01:23
@Christopher2EZ4RTZ Unit tests are easy. Being sure that you're done writing unit tests is hard. Automatic code coverage tools like coveralls helps with that.
@Mego It seems like you're using an access_token as a user's id in the DB but that will change when the user logs in again, no?
Anonymous
@Downgoat The access_token bit from the POST response is the part we're interested in. If we set the no_expiry field, we don't ever need to change it, so logging in won't require redoing the auth request.
Anonymous
@Christopher2EZ4RTZ This is straying really far from this room's topic.
@Mego I came from TNB so i fix it back
Anonymous
7 messages moved to Trash
01:29
Not exactly on topic for TNB either but I don't think anyone cares about what's on topic there.
That was the joke :|
@Mego how would we know which user was just authorized?
would the same access_token be returned
Anonymous
@Downgoat Authorization would be done in a single session, so then we can tie an access token to a user_id (our internal IDs)
btw I just updated the PR to address your comments
what's the difference between a post and an answer/comment
Anonymous
01:51
@Downgoat In SE terms: post = question, answer = answer, comment = comment
It's just lovely because SE refers to questions and answers collectively as posts.
Anonymous
Yeah, I wanted to separate them out for a better hierarchical DB setup
Given we have a site dedicated to code-golf, I propose we call them challenges and solutions.
oh ok
@Pavel we can call it whatever on frontend but I think on backend it would be better for it to be more generic than less = better
Anonymous
@Pavel a) Competitive programming in general, not just code golf. b) I want this to support Q&A related to competitive programmming, too.
01:54
@Mego You mean like tips? That should be it's own thing entirely.
Maybe like wikis for langs
do we want to do an infinite scroll or pagination?
Anonymous
For more generic, we could rename answer to response, but then that will conflict with the HTTP response stuff
Anonymous
@Pavel I'm thinking we should have 3 parts to the site: main for challenges, meta for meta, and q&a for q&a
Anonymous
@Downgoat Probably pagination, to be nice to mobile users
We could also detect if the user has a mobile browser or not.
01:57
responsive > mobile detection
idk how to do paginated SQL query
And infinite scroll is nicer for desktop users
Since a post list is discovery, infinite scroll would be better from UX perspective
Anonymous
But with infinite scroll, it's really hard to get to the last result. Imagine if the Sandbox had infinite scroll, and you actually had a reason to look at the last page.
btw what do we want on home page
we could go the way of quora/SE with a hot challenge feed
@Mego Just press the end key
Anonymous
01:59
@Downgoat Giant penguin. When we think of something better (unlikely), then we can change it.
@Mego See this is why Goat is doing frontend.
Anonymous
@Pavel Which either scrolls you down to the end of the current "page", or scrolls you to the end of the content and surprise you have potentially a few hundred things loaded. Also where is the end key on mobile? :P
bueno?
@Mego There isn't one, which is why I suggested detecting if it's mobile or not and doing infinite scroll on Desktop and pages on mobile.
@Downgoat I expected it to look like utter crap but that actually looks nice wtf
Anonymous
@Downgoat Perfect.
Anonymous
02:01
@Pavel A symmetric UX between desktop and mobile would be better.
Idea: Do pages, but you can set the number of answers per page, and the default is higher on desktop so that for most challenges you'll be able to see all the answers on one page.
Anonymous
Maybe I'm just old fashioned, but I feel that infinite scroll is inferior because it takes control away from the user. Imagine a user going "oh I remember that, it should be on page 87/90". With pagination, they go directly to page 87. With infinite scroll, they give up around page 5.
Anonymous
@Pavel Idea for building off of that: posts are collapsable to just the header, and they start collapsed by default.
eehh
I was thinking things like explanation are collapsed by default
but like header + code is shown
02:05
@Mego Since most posts would be one line anyway, it could also just collapse the explanation.
code is limited to like 8 lines maybe unless "see more" is click
Ninja'd
Anonymous
That could work, too
Anonymous
Collapse the code inside of the code box, and the explanation. More information in less space.
idea: have like two buttons, one for like typical se-esque list view of answers, another views all answers in like grid so you can see like 12 at a time
02:06
Anyway, you know how in SQL we can make a query like SELECT * FROM answers WHERE post_id = <post_id> LIMIT 10 to get the first 10 entries? How do you get the next 10 entries, without doing LIMIT 20 and manually discarding the first 10?
Anonymous
@Pavel You would do the request normally, without the LIMIT 10, but only scroll through the rows 10 at a time on the server side
@Pavel .yield_per(10) in sqlalchemy
Got it.
Do we want a side bar or something
Anonymous
Probably eventually, with featured/hot posts from each section
02:29
where should the "Post Challenge" button be
should it be in sidebar, or in header, or somewhere else
02:43
@Mego fixed to just POST
 
2 hours later…
Anonymous
04:19
@Downgoat Approved and pulled
oh that's cool
:| more JS than python apparently
btw in the new repo you need a GOOGLE_CLIENT_ID (from google dev portal) to use for google login support
Anonymous
I'm guessing that's something we'll need to load into real config.py instances
@server.route("/user/<int:user_id>", methods=['GET'])
def get_profile(user_id):
    try:
        uid = int(user_id)
    except:
        return

    return user.get_profile(uid)
is the int() part necessary?
Anonymous
04:51
@Downgoat It shouldn't be
Anonymous
05:27
@Downgoat 8/10 no giant penguin
05:42
Idea: 'parent tags'. e.g. fibonacci would have parent tag sequence and so all fibonacci challenges would go under sequence also
Anonymous
@Downgoat That's a good, complicated idea
btw what do we want to do for the editor we can:
1) use plain textbox
2) write our own markdown editor
3) use [Quill](https://quilljs.com)
4) use another existing markdown editor
Anonymous
I've used Quill before. It's nice.
Downside is I don’t think it does markdown
Anonymous
Doesn't look like it
Anonymous
07:42
@Downgoat That could work. We'd need to hack in TeX functionality
07:54
@Mego We could borrow some code from @ATaco's MathQuill.
 
4 hours later…
12:03
Do you think a WYSIWYG is necessary?
 
4 hours later…
16:08
@NieDzejkob definetly not. We could use ACE or something with our own markdown engine
That would allow us to easily add more features
16:25
tbh I'd say a plain textbox would be more than enough.
16:58
for now it would
So for posts I was thinking: markdown and then with a JS-markdown parser will show HTML preview and then we'll send the markdown to server which will keep markdown in DB, and we'll keep a pre-rendered version in redis which we can serve
meaning we need markdown engine in JS and python
unless we want to fork a node process
 
1 hour later…
18:36
I don’t think there’s is enough space to have both regular markdown editor and preview. We can either do tabs or WYSIWYG
18:49
@Downgoat I really would rather use markdown than WYSIWYG.
@Pavel it’s both
@Downgoat Are you referring to SimpleMDE?
That actually does look nice.
@Downgoat I feel like we need a better syntax highliting solution than Google Prettify. Prettify is just kinda bad and doesn't support enough langs. What do you use for GoaTIO?
@Pavel yeah. I’ll modify it if we go that route
@Pavel for GoaTIO I use codemirror for code editor and highlightjs for static code works nice
@Downgoat 10/10 supports mathematica
Also really easy to expand. I made syntax rules for bf brainflak etc
19:02
Really want to use solarized dark but wouldn't fit in with the rest of the page well I think
Unless we have a dark theme
19:41
@Pavel Is the theme I use on GoaTIO OK?
btw what should I do with the sidebar on mobile
Should I just hide it
Ye I think
@Downgoat The dark theme is good. Vihan.org seems to be down
use https
idk why apache is doing that
@Downgoat 0/10 GoaTIO doesn't support Mathematica syntax highlighting
(If you go fix that, Mathics uses the same highlighting)
Also, light mode doesn't have syntax highlighting
Are you on mobile?
MAKe sure you select a language like python that supports highlighting
@Downgoat I am
@Downgoat Well never mind I plugged it into the input field
I do that every time I use GoaTIO.
20:44
so what textbox are we using?
btw @Mego is it possible to move this repo to the ppcg/ org (or another org)? That way if I fork something it can all be under 1 org
Anonymous
@Downgoat I don't really see the benefit for just 3 people working on it, but if you guys want to, I will
It doesn't like like SimpleMDE is maintained anymore :/
read -p "MySQL username: " sql_username
read -s -p "MySQL password: " sql_username
setup.sh bork?
I made a PR to change that last line to sql_password which should work.
yeah, just approved
ty
20:54
how do we do websocket with flask?
i.e. websocket to show new post
I am going to do tabs for the editor
21:20
CMP: favorite monospace font
@Downgoat Fira Code if ligatures are supported and Fira Mono otherwise
Actually, most people don't like ligatures, so Fira Mono
Roboto Mono is also good
Source Code Pro might be suited too, although I like Fira Mono more
(The former is a typeface)

« first day (7 days earlier)      last day (627 days later) »