|
MrMoo posted:I just found NW.js, wow people are masochists. NodeJS running in Chromium. okay maybe i'm just really loving stupid, but what is the point
|
# ? May 15, 2020 15:58 |
|
|
# ? May 18, 2024 02:14 |
|
Inacio posted:okay maybe i'm just really loving stupid, but what is the point if i had a nickel for every time someone who doesn't know the difference between browser and node.js finds some node module and is like "why can't we use this to solve xxxx" front end problem i'd have a bunch of nickels. explaining what node.js was to people was the bane of my front end existence. granted this idea is stupid and shouldn't exist but i can see the rationale.
|
# ? May 15, 2020 16:50 |
|
go play outside Skyler posted:I don't get the point with deno. NPM is so bad because you just install random packages from Git, so let's make it so that every package is just included by inserting some url directly in the source file? What makes the deno servers more secure than say some other random persons github repository? Wait, are you saying you think NPM installs from or with git?
|
# ? May 15, 2020 17:49 |
|
I haven't really used NodeJS before so I might be wrong here, but I assumed the big deal with Deno was that it's easier to write & distribute server-side JS code. Like, you could build an app with Node, bundle it with webpack, and run it with "deno my_webpacked_bundle.js". So at runtime you don't have to worry about pre-installing a bunch of node_modules or downloading anything from the net, unless you want to. Is that correct?
|
# ? May 15, 2020 18:26 |
|
minato posted:I haven't really used NodeJS before so I might be wrong here, but I assumed the big deal with Deno was that it's easier to write & distribute server-side JS code. Like, you could build an app with Node, bundle it with webpack, and run it with "deno my_webpacked_bundle.js". So at runtime you don't have to worry about pre-installing a bunch of node_modules or downloading anything from the net, unless you want to. Is that correct? Deno is supposed to be an alternative to node, it does the same things. The problem that most people have isn't the Node V8 engine, it's npm npm is what's responsible for node_modules being what it is Deno doesn't have a package manager (yet) but has a standard library and allows for 3rd part modules included from repos or cdn
|
# ? May 15, 2020 18:40 |
|
Thermopyle posted:Wait, are you saying you think NPM installs from or with git? I meant GitHub, but yeah, I'm pretty sure a majority of npm packages pull directly from github E: to be precise, I believe npm publish just points npm to a specific commit on a public github repo when they are hosted there
|
# ? May 15, 2020 23:10 |
|
go play outside Skyler posted:I meant GitHub, but yeah, I'm pretty sure a majority of npm packages pull directly from github How the author publishes to npm is almost irrelevant. The module itself after being published is hosted by npm and when you do an npm install it gets pulled from the npm servers. Fe: Unless you explicitly state in your package.json that the module you want is hosted as a git repo, but that is not the normal process
|
# ? May 15, 2020 23:25 |
|
The Fool posted:Fe: Unless you explicitly state in your package.json that the module you want is hosted as a git repo, but that is not the normal process The fact that is even a possibility boggles the mind. I get the convenience, but ughh.
|
# ? May 15, 2020 23:39 |
|
go play outside Skyler posted:I meant GitHub, but yeah, I'm pretty sure a majority of npm packages pull directly from github Well, I mean...all code comes from somewhere. Sometimes it comes from github sometimes it comes from your system, but when you npm install it's coming directly from npm's servers.
|
# ? May 15, 2020 23:40 |
|
The public Youtube api abbreviates the subscriber count in a way that's useless for looking at day to day trends by rounding it up thousands, tens of thousands, etc. Does anyone know if the's a way to get the exact number? I mean other than by scraping it off the youtube page (if they do in fact show the real number). The docs say this:code:
|
# ? May 16, 2020 19:21 |
|
IIRC, you get the full number via youtube/v3/channels?part=statistics for channels with API key. Even if you scrape, public interface shows "405K" or "1.9M" or etc.
|
# ? May 16, 2020 19:39 |
|
theres no bounds how stupid youtube can be
|
# ? May 16, 2020 21:42 |
|
code:
I get the abbreviated results even if I don't use my channel id. But looks like it might be possible to get more precise numbers from the analytics API but it requires OAuth
|
# ? May 17, 2020 11:36 |
|
mobby_6kl posted:
If you don’t have a way to get the state and code You can run a little flask server to do that.
|
# ? May 17, 2020 13:52 |
|
IIRC the intent is that exact sub counts should be private.
|
# ? May 17, 2020 14:55 |
|
CarForumPoster posted:If you don’t have a way to get the state and code You can run a little flask server to do that. quote:Welcome to Flask’s documentation. Get started with Installation and then get an overview with the Quickstart. There is also a more detailed Tutorial that shows how to create a small but complete application with Flask. Common patterns are described in the Patterns for Flask section. The rest of the docs describe each component of Flask in detail, with a full reference in the API section. Biowarfare posted:IIRC the intent is that exact sub counts should be private.
|
# ? May 18, 2020 00:59 |
|
Youtube bots that are boosting a particular channel also subscribe to a whole bunch of other channels to try and blend in with legitimate users. Hence, the approximation is more consistent over time, rather than fluctuating as bots subscribe and are then banned.
|
# ? May 18, 2020 04:19 |
|
mobby_6kl posted:Probably (or even more likely, to prevent third parties from getting any useful data from the API) , but all the documentation claims it's to make the numbers "more consistent" It does actually accomplish the goal of making it more consistent, just like the view counter
|
# ? May 18, 2020 08:11 |
|
mobby_6kl posted:I don't know yet if I don't have a way to do that, I'm just lazy. But thanks, I'll check out Flask.. I’ll give you some python code in a few hours. I run it from a Jupiter notebook because all I need is the URL that I get as a response with the token and state. Note that I only need to run this code once per month so it’s done as lazily as possible.
|
# ? May 18, 2020 13:42 |
|
This oauth2 code uses a self signed 'adhoc' SSL certificate and runs on localhost to get the stuff you need to connect to an API that requires OAuth. This is not a very secure/production way to do this, but it works for code that I run one time per month to gather some data/stats. For the redirect URL I give it localhost. The tokens it gives you usually expire. This doesnt handle that because for me they expire well past when I finish getting what I want. You run it, it majkes a webpage with a link you click that redirects you to that app's login page. I login and it redirects me back to this server with the code and state in the redirect URL. I used this as an example: https://github.com/reddit-archive/reddit/wiki/oauth2-python-example code:
|
# ? May 18, 2020 15:41 |
|
Does anyone have an example of a super basic CSS grid that works in IE? I tried the following, but all the cells go on top of each other in IE:code:
EDIT: Oh wtf, I have to individually place every cell in IE? code:
The Merkinman fucked around with this message at 14:38 on May 19, 2020 |
# ? May 19, 2020 14:30 |
|
The Merkinman posted:Does anyone have an example of a super basic CSS grid that works in IE? I tried the following, but all the cells go on top of each other in IE: These were very helpful when I had to do grid with ie11 support https://css-tricks.com/css-grid-in-ie-debunking-common-ie-grid-misconceptions/ https://medium.com/@elad/supporting-css-grid-in-internet-explorer-b38669e75d66
|
# ? May 19, 2020 17:11 |
|
Lumpy posted:These were very helpful when I had to do grid with ie11 support Right but that first link about explicit/implicit grid shows that I'd have to place every single item, and given this was for a product grid with up 120 items (and 3 different grids differing on screen size!). It feels like a non-starter.
|
# ? May 19, 2020 20:28 |
|
e: nm!
|
# ? May 19, 2020 20:34 |
|
The Merkinman posted:Right but that first link about explicit/implicit grid shows that I'd have to place every single item, and given this was for a product grid with up 120 items (and 3 different grids differing on screen size!). It feels like a non-starter. Well if it tells you it would be too much of a pain in the rear end to do, it was helpful, right?
|
# ? May 19, 2020 21:19 |
|
I'm making a website and don't want to use Javascript/WASM etc. It's for displaying info, not an app. To make it render diff on mobile, do I need to detect it on the server, or is there a way to quickly inject javascript? Pseudocode:HTML code:
I'm using 0 frameworks etc.
|
# ? May 21, 2020 03:46 |
|
You do that with CSS media queries.
|
# ? May 21, 2020 03:53 |
|
Oh poo poo that looks like the soln. edit - works. You da man. Dominoes fucked around with this message at 03:59 on May 21, 2020 |
# ? May 21, 2020 03:56 |
|
Got another - what's the best way to keep track of a shopping cart that's not associated with a database user? Cookies? localStorage? I think this page might be what I want.
|
# ? Jun 5, 2020 02:47 |
|
Dominoes posted:Got another - what's the best way to keep track of a shopping cart that's not associated with a database user? Cookies? localStorage? I think this page might be what I want. With HTML5 on a competent browser local storage seems the best way to go. There's no reason to go back to the old cookie method, unless you wanna track the users serverside (for your own nefarious purposes unrelated to the shopping cart itself).
|
# ? Jun 5, 2020 02:51 |
|
Dominoes posted:Got another - what's the best way to keep track of a shopping cart that's not associated with a database user? Cookies? localStorage? I think this page might be what I want. localStorage is trivial, should be good. just a simple json and you're done. e: could also do sessionStorage if you want it to go away
|
# ? Jun 5, 2020 13:32 |
|
Be aware that localStorage sessionStorage may not work on browsers running in private/incognito etc modes.
|
# ? Jun 5, 2020 14:07 |
|
The Merkinman posted:Be aware that localStorage sessionStorage may not work on browsers running in private/incognito etc modes. Yep, been down that road. Had to implement a small polyfill for browsers that threw an exception. Safari was one of them. Hell, I remember even one time having users report issues with a web app running on IE on Windows Phone because it threw an exception on console.log. Like, the console object was literally not there. Welcome to the world of mobile browser compatibility I guess. I could write an entire thread on that topic. Thank god for webpack.
|
# ? Jun 5, 2020 16:25 |
|
go play outside Skyler posted:Hell, I remember even one time having users report issues with a web app running on IE on Windows Phone because it threw an exception on console.log. Like, the console object was literally not there. In IE 9 and before, console.log would always throw an exception if the browser F12 debugger console window was not open, because opening the debugger would make that object exist.
|
# ? Jun 5, 2020 16:41 |
|
in theory (very relevant when talking about crossbrowser compatibility), private and incognito should only clear on close:MDN posted:Data in a localStorage object created in a "private browsing" or "incognito" session is cleared when the last "private" tab is closed
|
# ? Jun 5, 2020 16:55 |
|
Quick CSS grid question: I feel like there should be an easy way to do this without using JavaScript, but I haven't been able to crack it. My guess is that it's a limitation in the grid spec, but I want to confirm before I start giving spiels about this taking more dev hours. I have two columns that need to house a variable number of items. It's pretty easy to just have things go from left to right. However, if I want items to first populate the left column and then once they reach the halfway point to begin populating the right column, is there an easy CSS way to do it? Right now, I set `grid-auto-flow:` to `column` and I have to know the number of items ahead of time and manually set the grid-template-rows (e.g., if I have 7 items, I need to set `grid-template-rows:` to `repeat(4, 100px)`). Is there a better way, or am I just going to run some extra JS every time the number of items in my grid changes?
|
# ? Jun 5, 2020 19:38 |
|
fsif posted:Quick CSS grid question: I feel like there should be an easy way to do this without using JavaScript, but I haven't been able to crack it. My guess is that it's a limitation in the grid spec, but I want to confirm before I start giving spiels about this taking more dev hours. Use flexbox instead of grid in there?
|
# ? Jun 5, 2020 20:01 |
|
Lumpy posted:Use flexbox instead of grid in there? I'll run into the same problem there, though, no? I'll either need to set a fixed height (which is effectively the same issue I'm having with grid-template-rows) or I'll risk the content spilling over to more columns than just the two I want.
|
# ? Jun 5, 2020 20:14 |
|
CSS multi column layout would work if you don't mind different sized items not lining up. You might have to set a few more properties for blocks to play nice with the columns as they're intended for inline content.
|
# ? Jun 5, 2020 20:25 |
|
|
# ? May 18, 2024 02:14 |
|
Thanks dudes - localStorage works good, and has good API.
|
# ? Jun 6, 2020 01:23 |