|
Chenghiz posted:This sounds like a great use case for react-grid-layout: https://github.com/STRML/react-grid-layout Thanks, this is exactly what I was looking for.
|
# ? Nov 18, 2015 06:25 |
|
|
# ? May 15, 2024 04:32 |
|
Anyone got any pro tips related to REST/HATEOAS API design, implementation, authentication, etc? Broad articles welcome, best practices, examples of systems you like, or anything related to dropping one on Symfony2 would be ace.
|
# ? Nov 19, 2015 11:51 |
|
v1nce posted:Anyone got any pro tips related to REST/HATEOAS API design, implementation, authentication, etc? Broad articles welcome, best practices, examples of systems you like, or anything related to dropping one on Symfony2 would be ace. This might help https://leanpub.com/build-apis-you-wont-hate
|
# ? Nov 19, 2015 13:48 |
|
I'm working on a tutorial for Google Web Toolkit, but I feel like it's outdated due to some library changes I have had to make. It says that Firefox can't use the key press event, is that true? Is there a better universal way to register a keypress?
|
# ? Nov 19, 2015 21:45 |
|
I have a multi-select in a form that looks likecode:
I don't mean I'm using PHP for the first time and don't know where in $POST to look for it, I mean I'm inspecting the request in the network tab in the debugger and "Things" is not on the list of values sent to the server. The server (which is ASP MVC, not PHP) also isn't getting a "Things" in the form data, so it's not like the browser is eliding it from the tab as a bug. What the hell am I not seeing here?
|
# ? Nov 19, 2015 22:29 |
|
I might be off base on this but don't you have to do name="stuff[]" for a multi-select?
|
# ? Nov 19, 2015 23:09 |
|
When js does its thing, does the select get populated with <option> tags?revmoo posted:I might be off base on this but don't you have to do name="stuff[]" for a multi-select? Php would fill the Things variable with the last item selected afaik, you right about that. But there are nothing is getting POSTed, so this problem cannot be a php thing. karms fucked around with this message at 01:57 on Nov 20, 2015 |
# ? Nov 20, 2015 01:53 |
|
Munkeymon posted:I don't mean I'm using PHP for the first time and don't know where in $POST to look for it, I mean I'm inspecting the request in the network tab in the debugger and "Things" is not on the list of values sent to the server. The server (which is ASP MVC, not PHP) also isn't getting a "Things" in the form data, so it's not like the browser is eliding it from the tab as a bug. What the hell am I not seeing here? Copy your <form> block and the JS to a jsfiddle and see if it still happens. If yes, show us the fiddle. If no, find the culprit by deleting other things from your site code until it works.
|
# ? Nov 20, 2015 03:43 |
|
There's no PHP involved. I just mention it because every result on Google is some PHP noob not knowing how to get the data into $_POST KARMA! posted:When js does its thing, does the select get populated with <option> tags? Yeah. You can see them there without inspecting, but they show up in the element inspector, too.
|
# ? Nov 20, 2015 15:31 |
|
There might be some javascript futzing with the submitting of the form, altering it before posting?
|
# ? Nov 20, 2015 16:00 |
|
Munkeymon posted:There's no PHP involved. I just mention it because every result on Google is some PHP noob not knowing how to get the data into $_POST Are you adding disabled to any part of the select chain? Because that will stop it from showing up. Jsfiddle or something the entire thing + JS if you can.
|
# ? Nov 20, 2015 17:07 |
|
I'm actually just a moron who forgot to update the post handler that set the whole list selected when I changed the name on the markup to match the property name from the model so it would actually serialize correctly without some hacky bullshit manual deserialization (imagine that!). Just popped into my head during the standup this morning. E: I should probably replace this with a list of labels and checkboxes. The UX would be better and the UI would be less fragile. Munkeymon fucked around with this message at 17:43 on Nov 20, 2015 |
# ? Nov 20, 2015 17:39 |
|
Maluco Marinero posted:I like Fastmail, needs suiting, and a decent price. Belated thanks for this. Much easier to work with than Zoho.
|
# ? Nov 21, 2015 20:42 |
|
If I am using a Google font, what should my rel=“preconnect” and rel=“dns-prefetch” read? Especially since Google hits up both fonts.gstatic.com and fonts.googleapis.com.
|
# ? Nov 22, 2015 19:04 |
|
Can someone please provide me a high-level explanation of how to generate a .css file with JavaScript? Here's a scenario for clarification: User alters the styling of a page (with JavaScript/React), the user hits "save" and a new .css file is created on the server with the user's custom styling. Is it something like: place style rules in JS variables --> AJAX the variables down to a .php file --> generate .css file from the .php file? Is this anywhere close?
|
# ? Nov 25, 2015 20:39 |
|
caiman posted:Can someone please provide me a high-level explanation of how to generate a .css file with JavaScript? Here's a scenario for clarification: User alters the styling of a page (with JavaScript/React), the user hits "save" and a new .css file is created on the server with the user's custom styling. Are you sure thats what you want to do? Inline styles are A Thing That Is Done in React...so, like, the user changes some elements background-color to blue. You would just persist that selection however you want, local storage, AJAX post to your server, whatever, and then your React element uses style={{backgroundColor: yourStoredSelectionForThisElement}}
|
# ? Nov 25, 2015 20:45 |
|
Thermopyle posted:Are you sure thats what you want to do? Nope, I'm not. Thermopyle posted:Inline styles are A Thing That Is Done in React...so, like, the user changes some elements background-color to blue. You would just persist that selection however you want, local storage, AJAX post to your server, whatever, and then your React element uses style={{backgroundColor: yourStoredSelectionForThisElement}} This seems like exactly what I'm needing. I'm just learning React so I wasn't even aware it could work like this. The thing I don't understand yet is how the React code in the client calls the saved styling on the server (if I did the "AJAX post to your server" option).
|
# ? Nov 25, 2015 20:54 |
|
caiman posted:This seems like exactly what I'm needing. I'm just learning React so I wasn't even aware it could work like this. The thing I don't understand yet is how the React code in the client calls the saved styling on the server (if I did the "AJAX post to your server" option). You would get it via AJAX from the server. I kind of feel like this is an XY problem, but anyway...if you're wanting each user of your site to be able to save their own custom styling, I would just save it to local storage on their end and not worry about saving it to the server. For one thing, unless you're having user accounts already, you've got to set up a whole system of authenticating and verifying users. So your React components using user-defined styles could read/write them from localStorage like the examples here.
|
# ? Nov 26, 2015 00:38 |
Thermopyle posted:I kind of feel like this is an XY problem Heh, thanks for this link. Rings nice and true for me. I just came from a day at work where I found myself unexpectedly in charge of a team spread across two cities trying to figure out why our internal system (basically nothing more than your bog-standard tabular data display) had started out fast when it was new but now was so goddamned slow even to just scroll the browser that it was basically unusable. After half an hour fumbling around in a screensharing group with timeline viewers and Django-toolbar'ing the API endpoint and adding debug statements everywhere to try to figure out why it took five seconds just to render the page after getting the API response, it comes out that they had decided to build the thing on AngularJS and were building the entire table view dynamically on the client side after pulling the entire, unpaginated data set via the API call. Well of loving course it's going to get slower over time, geniuses. That API call is returning 8000 rows now, all of which the client has to juggle and filter and render into HTML, and every time any event fires it reevaluates the entire freaking app, and you'll be lucky if the client performance only degrades linearly rather than geometrically with data size. This is like the textbook case where you absolutely do not want to use Angular. Filter and paginate the loving thing on the server like people have been doing for 20 years, you're not going to suddenly reinvent the concept of a tabular data view and create an amazing new user interface paradigm on some internal tool. Let's fumble around for a year trying to figure out how to do Angular properly! But for heaven's sake don't even suggest not using Angular...
|
|
# ? Nov 26, 2015 01:02 |
|
Data Graham posted:Heh, thanks for this link. Rings nice and true for me. I just came from a day at work where I found myself unexpectedly in charge of a team spread across two cities trying to figure out why our internal system (basically nothing more than your bog-standard tabular data display) had started out fast when it was new but now was so goddamned slow even to just scroll the browser that it was basically unusable. After half an hour fumbling around in a screensharing group with timeline viewers and Django-toolbar'ing the API endpoint and adding debug statements everywhere to try to figure out why it took five seconds just to render the page after getting the API response, it comes out that they had decided to build the thing on AngularJS and were building the entire table view dynamically on the client side after pulling the entire, unpaginated data set via the API call. Well of loving course it's going to get slower over time, geniuses. That API call is returning 8000 rows now, all of which the client has to juggle and filter and render into HTML, and every time any event fires it reevaluates the entire freaking app, and you'll be lucky if the client performance only degrades linearly rather than geometrically with data size. This is like the textbook case where you absolutely do not want to use Angular. Filter and paginate the loving thing on the server like people have been doing for 20 years, you're not going to suddenly reinvent the concept of a tabular data view and create an amazing new user interface paradigm on some internal tool. This should not take anywhere near a year... there are a number of readily available virtual scroll directives available which will allow you to easily render arbitrarily large datasets without pagination. I've gotten a lot of use out of https://github.com/kamilkp/angular-vs-repeat.
|
# ? Nov 26, 2015 01:24 |
Skandranon posted:This should not take anywhere near a year... there are a number of readily available virtual scroll directives available which will allow you to easily render arbitrarily large datasets without pagination. I've gotten a lot of use out of https://github.com/kamilkp/angular-vs-repeat. Nice. I assume this deals with selecting paginated slices from the API call? The demo just synthesizes an array of X size, no external data source. I assume one of the purposes of this is to avoid having to pull all 8000 rows from the API with every page load? Because goal 1 for me would be to not have to worry about what happens at 80,000.
|
|
# ? Nov 26, 2015 01:38 |
|
Data Graham posted:Nice. I assume this deals with selecting paginated slices from the API call? The demo just synthesizes an array of X size, no external data source. I assume one of the purposes of this is to avoid having to pull all 8000 rows from the API with every page load? Because goal 1 for me would be to not have to worry about what happens at 80,000. It takes your data source and creates a virtual scrollbar. Only the elements visible are actually rendered, and as you scroll through the list they will be dynamically added/removed. So rendering 1,000 is the same as 1,000,000. I've built log viewers that can filter & render up to 2 million logs in the client with no problem. The only reason there is a max at 2 million is the available RAM to hold onto the data in Chrome (~1gb).
|
# ? Nov 26, 2015 01:41 |
Yeah, but I mean I'm not keen on a) using that much browser RAM or b) transferring that much data with every call to the data source. I don't want a simple page load to be pulling a million records, regardless of how it gets rendered.
|
|
# ? Nov 26, 2015 01:43 |
|
Data Graham posted:Yeah, but I mean I'm not keen on a) using that much browser RAM or b) transferring that much data with every call to the data source. I don't want a simple page load to be pulling a million records, regardless of how it gets rendered. Right, sorry, I misunderstood your question. There are some other directives that you could use to also add in loading your data in pages, I just can't think of one off the top of my head. This one directly addresses the AngularJS rendering issue.
|
# ? Nov 26, 2015 01:46 |
Okay, cool. Still worth a look, so thanks for the pointer.
|
|
# ? Nov 26, 2015 01:52 |
|
Okay, I've been wrangling this for the past two days, so I'll ask: is there any way using CSS for truncating single-line text to fit a variable-width div whose size is dictated ? display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; is weirdly specific about when and where it will or will not work. (I have on one page where one DIV is properly cutting off excess text, yet adamantly refusing to do the same for another DIV.) If not, is there some jquery solution to do the same thing?
|
# ? Nov 26, 2015 09:45 |
|
What's the Best Practices way to organize an API to use WebSockets? Working on a personal project, I've decided that I'm probably going to need a WebSocket server for sending data to the user, so I'm looking into this library, which seems easy to work with. Given the example on that page, the best option for organizing the API seems to be either a single server, with each call handled in a large OnMessage handler, or a server instance for each API call, but neither feels quite right to me.
|
# ? Nov 26, 2015 10:27 |
|
darthbob88 posted:What's the Best Practices way to organize an API to use WebSockets? Working on a personal project, I've decided that I'm probably going to need a WebSocket server for sending data to the user, so I'm looking into this library, which seems easy to work with. Given the example on that page, the best option for organizing the API seems to be either a single server, with each call handled in a large OnMessage handler, or a server instance for each API call, but neither feels quite right to me. It all depends how far you desire to cope with scale. A very elegant method is to use Mongrel2 to fan out all HTTP and WebSocket requests over ZeroMQ then you can have farms of servers handling requests however you desire.
|
# ? Nov 26, 2015 15:56 |
|
darthbob88 posted:What's the Best Practices way to organize an API to use WebSockets? Working on a personal project, I've decided that I'm probably going to need a WebSocket server for sending data to the user, so I'm looking into this library, which seems easy to work with. Given the example on that page, the best option for organizing the API seems to be either a single server, with each call handled in a large OnMessage handler, or a server instance for each API call, but neither feels quite right to me. A single OnMessage handler is just how Websockets works, but that doesn't mean all your code has to be in there, that's just the entry point for your messages. I'd start with a simple single server, with a well organized OnMessage handler which identifies the message, and routes to the appropriate handler.
|
# ? Nov 26, 2015 17:56 |
|
Morroque posted:Okay, I've been wrangling this for the past two days, so I'll ask: is there any way using CSS for truncating single-line text to fit a variable-width div whose size is dictated ? display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; is weirdly specific about when and where it will or will not work. (I have on one page where one DIV is properly cutting off excess text, yet adamantly refusing to do the same for another DIV.) If not, is there some jquery solution to do the same thing?
|
# ? Nov 26, 2015 18:23 |
|
Skandranon posted:A single OnMessage handler is just how Websockets works, but that doesn't mean all your code has to be in there, that's just the entry point for your messages. I'd start with a simple single server, with a well organized OnMessage handler which identifies the message, and routes to the appropriate handler. code:
code:
darthbob88 fucked around with this message at 19:30 on Nov 26, 2015 |
# ? Nov 26, 2015 19:24 |
|
For my next project I'm going to help an NGO (or fail and tell them they need to pay someone) design a world map of all their projects with a popup showing some basic information like who where and what. I haven't branched into this kind of stuff except for some potentially useful experience with jQuery and JavaScript. Ideally the popup information will be stored in an Excel sheet or easily converted to some other database format. What would I need to learn to get a very basic setup up and running?
|
# ? Nov 30, 2015 03:30 |
|
huhu posted:For my next project I'm going to help an NGO (or fail and tell them they need to pay someone) design a world map of all their projects with a popup showing some basic information like who where and what. I haven't branched into this kind of stuff except for some potentially useful experience with jQuery and JavaScript. Ideally the popup information will be stored in an Excel sheet or easily converted to some other database format. What would I need to learn to get a very basic setup up and running? A cursory google tells me you can do this with Google Maps and Fusion Tables via either Google Docs or API, or there's all this crap if you just want to use JavaScript.
|
# ? Nov 30, 2015 04:56 |
|
huhu posted:For my next project I'm going to help an NGO (or fail and tell them they need to pay someone) design a world map of all their projects with a popup showing some basic information like who where and what. I haven't branched into this kind of stuff except for some potentially useful experience with jQuery and JavaScript. Ideally the popup information will be stored in an Excel sheet or easily converted to some other database format. What would I need to learn to get a very basic setup up and running? Don't try to use the Excel file on the website, build something that reads it at compile time and converts it to something usable by whatever your website will use.
|
# ? Nov 30, 2015 05:59 |
|
huhu posted:For my next project I'm going to help an NGO (or fail and tell them they need to pay someone) design a world map of all their projects with a popup showing some basic information like who where and what. I haven't branched into this kind of stuff except for some potentially useful experience with jQuery and JavaScript. Ideally the popup information will be stored in an Excel sheet or easily converted to some other database format. What would I need to learn to get a very basic setup up and running? I'd use google charts and either a map or geochart (check out the first example here: https://developers.google.com/chart/interactive/docs/gallery/map )
|
# ? Nov 30, 2015 14:00 |
|
Edit: Nevermind
poxin fucked around with this message at 08:14 on Dec 3, 2015 |
# ? Dec 3, 2015 07:54 |
|
Anyone else unable to login to namecheap.com at the moment? It's making for a difficult day.
|
# ? Dec 3, 2015 17:05 |
|
Just logged in no problem.
|
# ? Dec 3, 2015 17:13 |
|
Thanks, working for me now too
|
# ? Dec 3, 2015 17:22 |
|
|
# ? May 15, 2024 04:32 |
|
Hi guys, I'm planning on making a basic portfolio site for a small business. If I want to dabble with Jekyll, should I just use netlify? It's a business to business type of company so there won't be too many hits and inquiries. The only tricky thing I'm reading about is form and email handling, but Netlify on the surface seems to handle forms as well. Whereas if I host on S3, I need to incorporate another email service like Mandrill? Oh and some customers would be in China so what problems will I have dealing with the stupid FireWall?
|
# ? Dec 7, 2015 08:42 |