nomatteus / dinesafe Goto Github PK
View Code? Open in Web Editor NEWDinesafe Rails App: JSON dump processing, data updating, and API for my iOS app.
Home Page: http://dinesafe.to/app/
Dinesafe Rails App: JSON dump processing, data updating, and API for my iOS app.
Home Page: http://dinesafe.to/app/
Something to consider
Instead of the custom get_distance_km
function, look into using these postgres extensions: cube
and earthdistance
:
Check out this tutorial: http://johanndutoit.net/searching-in-a-radius-using-postgres/
Should be faster as these are official extensions, not some random function. Profile some queries and test it out to be sure!
Note that the above assumes the earth to be perfectly spherical. Should be accurate enough though. (But if not, the PostGIS is the answer...).
Also note: Since this is a significant change, and will likely require changing db structure etc., set up another digital ocean server to use as a dev server. But then promote it to be the production server when it's ready. Use the next fastest one! ($10/mo, 1GB RAM) Right now it's chugging...
Same as nomatteus/dinesafe-ios#7 but on the site.
Relevant page: http://dinesafe.to/app/about
JBuilder is taking ~300ms to render. DB queries have been speed up a lot (from ~600ms to ~120ms), and now JBuilder is the bottleneck.
Even just using ditching jbuilder partials cuts view loading time in half. But just skip that and render JSON directly.
Data is available in CSV, XML, and XLS formats: http://opendata.peelregion.ca/data-categories/food-check/food-check-peel.aspx
Notes:
For whatever attributes we want to filter on:
Some ideas:
perfect_record
: All inspections passed. Gold star! (Should places that have all passed but some infractions still count as perfect? Maybe not... see what the #'s are like.)long-term safety (?)
: A place that has been around for a while (say at least 2 or 3 years), has passed all inspections, and has no crucial infractions. Basically like above but a subset of places that have been open for quite a while.has_been_closed
: Any place that has been closed at any time in the past. This is an interesting one--allows you to see a list of all the places that have closed...has_had_conditional
: Any place with at least one conditional.has_recent_conditional
: Any place with at least one conditional in the past X time period. (where perhaps X = a year?)has_crucial_infraction
: Has at least one inspection that had a crucial infraction. Could do same for significant....
:Improvements:
Tech:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.